Multilingual PDF Document Translation and Cost Tracking Automation - n8n Workflow

This advanced n8n workflow translates uploaded PDF documents into up to two target languages using Google Translate, handles conversion via ConvertAPI, and tracks API costs using specialized n8n node logic.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Consultants & Agencies: Needing quick, automated document localization services.

  • Technical Writers: Seeking to generate multilingual versions of manuals or reports efficiently.

  • Automation Specialists: Looking for complex n8n templates that combine cloud services (Google Translate) and conversion APIs (ConvertAPI).

  • Finance/Operations Teams: Requiring automated cost tracking for recurring API usage within an n8n workflow.

Overview

This comprehensive n8n workflow addresses the challenge of bulk document localization and the subsequent need for operational cost transparency. Starting with a simple form n8n trigger, it accepts a PDF and up to two desired target languages.

The automation leverages the power of n8n node structure to manage the entire lifecycle: extraction, translation using Google Translate's highly capable service, reformatting into structured HTML, and finally converting the translated content back into high-quality PDFs using ConvertAPI.

A key feature of this n8n workflow is the integrated cost tracking module, which calculates API usage expenses before delivering the translated documents via Gmail. This makes the n8n templates ideal for professional use cases where budgetary oversight is crucial.

How it Works

The process is initiated by an n8n trigger, specifically the Document Translation Request (Form Trigger) which captures the user's uploaded PDF and language preferences.


  1. Preparation and Extraction: The initial Process Form Data node prepares variables. The Extract Text from PDF n8n node extracts all raw text. This raw text is then passed to the Convert to HTML code node to apply proper structure and styling necessary for accurate translation.

  2. Parallel Translation: The core flow splits. The first branch, Translate to Language 1 (using the Google Translate n8n node), executes mandatory translation. A conditional If n8n node (Has 2nd Language?) determines if the second branch, Translate to Language 2, should run.

  3. PDF Reconstruction: Both translated HTML outputs are prepared by specialized code nodes (Prepare HTML 1/2) before being sent to dedicated Convert HTML to PDF HTTP Request n8n nodes, which interface with ConvertAPI.

  4. Merging and Delivery: The converted PDF files are synchronized using the Merge Documents n8n node. A Prepare Email code node structures the attachments and content.

  5. Cost and Logging: The Cost – Build record n8n node calculates usage costs. This data is logged using the Data Table n8n node.

  6. Final Dispatch: A final If n8n node (Send Two Attachments?) directs the flow to the appropriate Gmail n8n node (Send Email (2 PDFs) or Send Email(1 PDF)) to deliver the finalized translated documents.

Installation Guide


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Translate Credentials: You must connect a Google Service Account credential to the Google Translate n8n node. Ensure the Google Translation API is enabled for this account.

  3. ConvertAPI Setup: The Convert HTML to PDF n8n node uses an HTTP Request to ConvertAPI. Configure your ConvertAPI secret, either directly in the HTTP Request query parameters or as an n8n credential.

  4. Gmail Credentials: Connect an OAuth2 credential to the Gmail n8n nodes (Send Email). This allows the n8n workflow to send the final documents.

  5. Activate: Save the n8n templates and activate the workflow. Access the webhook URL provided by the Document Translation Request (Form Trigger) to begin testing.

Node Details

Document Translation Request (Form Trigger):
Function: Serves as the initial n8n trigger, accepting file uploads (PDF) and user inputs (target languages) via a web form.
Key Configuration: Configured to listen on a specific webhook ID to start the n8n workflow execution.
Extract Text from PDF:
Function: Extracts the textual content from the binary PDF file uploaded via the n8n trigger.
Convert to HTML (Code Node):
Function: Transforms the extracted text into a structured HTML format, crucial for preserving context during translation and subsequent PDF conversion.
Translate to Language 1 / 2 (Google Translate n8n node):
Function: Executes the core translation logic, translating the formatted HTML content into the specified target language while preserving HTML tags.
Has 2nd Language? (If n8n node):
Function: A core logic flow control n8n node that conditionally executes the second translation path based on whether the user provided a second language input.
Convert HTML to PDF 1 / 2 (HTTP Request n8n node):
Function: Interacts with the ConvertAPI service to transform the translated HTML back into a PDF document, ensuring proper margins and formatting.
Cost – Build record (Code Node):
Function: Calculates and structures cost data based on API usage (translation character count, ConvertAPI conversions), enabling robust tracking for this n8n templates structure.
Send Email (Gmail n8n node):
* Function: The final action, sending the resulting PDF attachments to the user who submitted the form n8n trigger.

Related n8n Workflows

Paid

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

I help customers experience 10x faster ROI through AI Automation. AI Generalist | Pursuing Generative AI & ML(IIT-G) | Google Certified Prompt Engineer | Ex-VP | Ex-Microsoft | ISB Certified CTO & AI Leader | Azure & AI Strategist | 5X Azure | n8n level2 | Wellness Advocate & Cult Ninja

Featured*