Build an AI-Powered Document Translation Workflow Using n8n, OpenAI GPT, Google Docs, and Google Drive

Introduction & What This Automation Does
In this project, I built a fully automated Google Docs translation system using n8n, OpenAI GPT, Google Docs, and Google Drive. The goal of this automation is to automatically translate documents from one language to another without requiring any manual work after the initial setup.
The automation works by monitoring a specific Google Drive folder. Whenever a Google Docs file is placed inside this folder, the workflow automatically picks it up and begins processing it. The document content is translated into a target language using an OpenAI language model, then a translated Google Doc is generated and stored in a separate folder.
Once the translation is completed, the system also converts the translated document into a PDF. This makes it easier to distribute the translated result in a widely supported format.
All files are organized automatically inside Google Drive. The original document is moved to a completed folder, the translated Google Doc is stored alongside it, and the translated PDF is uploaded into a dedicated PDF folder.
Finally, the workflow sends an email report that includes links to the original document, the translated Google Doc, and the PDF version. This means that after dropping a document into the input folder, the entire process runs automatically from start to finish.
If you want to build this automation yourself, you can download the complete n8n workflow JSON from the link below and import it directly into your n8n instance.
https://drive.google.com/drive/folders/1JvQGktzbZyNcQL_JFck6q5DMaZtFnJrR?usp=sharing
Since the full workflow is provided, you can explore each node, study how the workflow is built, modify the logic, and adapt the system to your own use cases.
Before diving into the workflow explanation, let’s first take a look at the quick demo of how the system works.
Quick Demo
If you want to see the automation in action, you can watch the quick demo video below.
https://www.youtube.com/watch?v=7AQRGm9rXSg
The demo shows how a document is dropped into the Google Drive folder, automatically translated, converted into a PDF, and then delivered through email.
Technologies Used and Prerequisites
Before building this automation, there are several tools and services required. These tools work together to handle document storage, translation, workflow automation, and email notifications.
| Technology | Purpose |
|---|---|
| n8n | Workflow automation platform used to orchestrate the entire process |
| OpenAI GPT | Performs the document translation using a language model |
| Google Drive | Stores the original documents, translated documents, and generated PDFs |
| Google Docs | Used to store and manage the translated document content |
| Gmail | Sends the final translation report email |
Prerequisites required before running the workflow:
| Requirement | Description |
|---|---|
| n8n Instance | Self-hosted or cloud version of n8n |
| OpenAI API Key | Required for running the translation model |
| Google Account | Needed for Google Drive, Google Docs, and Gmail integration |
| Google Drive Folder Structure | Specific folders must be created to store pending documents and completed results |
Required Google Drive folders:
| Folder Name | Purpose |
|---|---|
| Pending Translation | Folder where users upload documents that need translation |
| Completed Translation | Stores original documents and translated Google Docs |
| Completed Translation PDF | Stores the generated translated PDFs |
These folders allow the automation to clearly separate documents that still need processing from documents that have already been completed.
Workflow Explanation
The main workflow is called Google Doc Translation Automation Main Workflow with PDF Conversion, and it acts as the central controller for the entire automation.
The workflow begins with two possible triggers. One is a schedule trigger, which allows the automation to run automatically at defined intervals. The second is a manual trigger, which allows the workflow to be executed manually during testing or debugging. Both triggers feed into the same workflow logic.
After the trigger, the workflow enters a Set Data node. This node defines key parameters used throughout the automation. These include the source language, the target language, and the email address that will receive the final translation report. Placing these settings at the beginning makes the workflow easy to customize.
The next step uses a Google Drive Search Files and Folders node. This node scans the Pending Translation folder and retrieves all Google Docs files inside it. Any document placed in this folder will automatically be picked up by the workflow.
Once the files are retrieved, the workflow enters a loop so multiple documents can be processed in a single run. Whether there is one file or ten files in the folder, the workflow processes each one individually.
Each document is passed into a subworkflow called Google Doc Translation Automation Sub Workflow.
The subworkflow is responsible for performing the actual translation process.
The entry point of the subworkflow is the When Executed by Another Workflow node. This node receives parameters passed from the main workflow, including the document ID, document name, source language, and target language.
Next, a Create Google Document node creates a new document that will store the translated result. This new document is saved in the Completed Translation folder and its name matches the original document with the target language appended.
The workflow then retrieves the content of the original document using a Get a Document node. This pulls the entire text that needs to be translated.
After retrieving the document content, a Code – Separate Content node splits the text into smaller chunks. The chunk size is set to approximately ten sentences. Breaking the document into smaller parts helps improve translation quality and prevents sending overly large inputs to the language model.
The output of this node is a list of content chunks.
A Split Out node then separates these chunks so they can be processed one by one.
The workflow then enters another loop where each chunk is sent to the Translate Document LLM Chain node.
This node uses an OpenAI chat model to translate the content chunk from the source language into the target language. The system prompt defines the translation instructions while the user message contains the document content.
A structured output parser is used to ensure that the translated result always follows a predictable JSON format. This guarantees that the translated text can always be extracted from a specific field called result.
Once a chunk is translated, an Update Document node appends the translated content to the translated Google Doc created earlier. This continues until the entire document has been translated.
When the translation is complete, the workflow performs two final actions inside the subworkflow.
First, the original document is moved from the Pending Translation folder to the Completed Translation folder.
Second, a Set Node prepares the output data including the result link, source link, and document name.
After all documents finish processing, the workflow returns to the main workflow where the translated documents are converted into PDFs.
A second loop called Loop Convert Document Results into PDF processes each translated document. Inside this loop, a Download Document and Convert to PDF node downloads the translated Google Doc and converts it into a PDF format.
Next, the Upload PDF node uploads the generated file into the Completed Translation PDF folder in Google Drive.
A final Set Output PDF node prepares the necessary data including the document name, source ID, translated document ID, and PDF ID.
After all PDFs are generated, the workflow aggregates the results and sends a final Gmail report email.
The email includes links to the original document, the translated Google Doc, and the translated PDF. If multiple documents were processed, a map function formats the email to display all results clearly.
At this point, the entire automation process is complete.
Summary
In this project, I demonstrated how to build a fully automated Google Docs translation pipeline using n8n, OpenAI, Google Docs, and Google Drive.
The automation continuously monitors a Google Drive folder, automatically translates any documents placed inside it, generates a translated Google Doc, converts it into a PDF, and then sends an email report containing all relevant links.
By combining workflow automation with language models, this system removes the need for manual translation workflows and makes document processing significantly faster and more scalable.
Because the full n8n workflow JSON is available, you can import the project directly, study how each node works, and modify it for your own automation projects. The same architecture can also be extended to other document processing tasks such as summarization, content rewriting, document classification, and more.
Thanks for reading, and I'll see you in the next project.



