Automatic Email Translation using OpenAI GPT-3.5 - n8n Workflow

Use this powerful n8n workflow to automatically detect the language of incoming Gmail emails and translate them instantly to English using OpenAI GPT-3.5. Optimize global communication.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Global Business Communicators: Teams receiving emails in various languages.

  • Automation Enthusiasts: Users looking for practical applications of AI and the n8n platform.

  • Technical Users: Individuals needing specialized n8n templates integrating complex API calls (like OpenAI) with email services.

  • Productivity Experts: Those seeking to eliminate manual translation steps from their daily routine.

Overview

Managing communication across different languages can be a significant drag on productivity. This specialized n8n workflow solves this by providing seamless, automated translation for your Gmail inbox.

Starting with the robust Gmail n8n trigger, the n8n workflow detects newly received, unread emails. It leverages the cutting-edge capabilities of OpenAI (specifically GPT-3.5-turbo for cost efficiency) to first identify the language and then, if the language is not English, translate the full body text. Finally, it formats the output into a new, clearly marked email and applies a custom label to the original message. This template is a perfect example of how powerful n8n templates can transform daily operations, ensuring you never miss the content of an important foreign-language email again.

How it Works

This fully automated n8n workflow runs on a polling schedule, typically every minute, ensuring swift processing of incoming mail.


  1. Initiation (The n8n Trigger): The Gmail New Email Trigger n8n node starts the process whenever a new unread email arrives in the monitored Gmail account.

  2. Data Preparation: The Normalize Email Data n8n node (a Code n8n node) standardizes the email content, cleans up HTML, and extracts critical details (sender, subject, plain text body) for the AI analysis.

  3. Language Detection: An OpenAI n8n node uses a conversational prompt to detect the original language of the email body.

  4. Conditional Check: The Need Translation? If n8n node evaluates the detected language. If the result is anything other than 'en' (English), the workflow proceeds down the translation branch.

  5. Translation: The second OpenAI n8n node receives the non-English text and executes the translation request, converting the text into fluent English.

  6. Output Preparation: The Prepare Translated Email Code n8n node takes the original email metadata and the newly translated text, combining them into a clear, formatted email body that includes the original source details and the detected language.

  7. Final Action: Two parallel Gmail n8n nodes execute: Send Translated Email forwards the new English version, and Add 'Translated' Label marks the original message in the user's inbox with a custom label (e.g., 'Translated Emails') to prevent reprocessing and maintain inbox organization. This robust n8n workflow ensures a clean, auditable process.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code and import it into your n8n instance via the 'New' menu -> 'Import from JSON'.

  2. Gmail Setup:

Create a new Gmail Credential if you don't have one, ensuring it has read and modify permissions.
Manually create the Gmail label 'Translated Emails' in your Gmail account (or update the label name in the final Add 'Translated' Label n8n node).

  1. OpenAI Setup:

Obtain an API Key from the OpenAI platform.
Create an n8n credential for OpenAI, supplying your API Key.
* Ensure both Detect Language (OpenAI) and Translate to English n8n nodes use this credential.

  1. Activation: Once credentials are set, activate the Gmail New Email Trigger n8n node to start the automation.

Node Details

This n8n template utilizes several critical n8n nodes:

Gmail New Email Trigger (n8n Trigger):
Function: Initiates the n8n workflow upon receiving an unread email.
Key Configuration: Filters set to only check for unread messages.
Normalize Email Data (Code n8n Node):
Function: Standardizes data structure, sanitizes HTML, and extracts the core text body. It also implements a simple logic check to skip emails shorter than 10 characters.
Detect Language (OpenAI n8n Node):
Function: Calls the OpenAI chat API (using GPT-3.5-turbo) to identify the language of the normalized email body.
Need Translation? (If n8n Node):
Function: Determines if the workflow should continue translation. The logic checks if the detected language (output from OpenAI) is not equal to 'en'.
Translate to English (OpenAI n8n Node):
Function: Performs the actual translation, converting the foreign text to English.
Prepare Translated Email (Code n8n Node):
Function: Structures the final translated output, including metadata headers to inform the recipient about the translation source and original language.
Add 'Translated' Label (Gmail n8n Node):
Function:* Updates the original email message by adding the custom 'Translated Emails' label, crucial for tracking processed messages within this n8n workflow.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
David Olusola
David Olusola

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - [email protected]

Featured*