πŸ’¬ Auto-translate incoming Gmail emails to English with OpenAI GPT-3.5

⚑ 167 views Β· πŸ’¬ Support Chatbots

Description

🌍 Auto-Translate Incoming Emails to English

This workflow automatically detects the language of every new Gmail email and translates non-English messages into English. The translated email is forwarded to your inbox with a clear β€œ[TRANSLATED]” subject tag, and a label is added for easy filtering.


βš™οΈ How It Works

  1. Gmail New Email Trigger

    • Listens for new unread emails in your Gmail inbox.
    • Captures subject, sender, body text, and metadata.
  2. Normalize Email Data

    • A Code node extracts the raw content from the email.
    • Strips HTML, normalizes plain text, and prepares data for language detection.
  3. Detect Language (OpenAI)

    • Uses OpenAI GPT-3.5-turbo to detect the email’s language.
    • If the language is English, workflow ends.
    • If not, continues to translation.
  4. Translate to English

    • OpenAI translates the email body into clear English.
  5. Prepare Translated Email

    • Builds a forwarded email containing:
      • Original sender & subject
      • Received date
      • Message ID
      • Translated content (with formatting)
  6. Send Translated Email

    • A Gmail node sends the translated message to your inbox.
    • Subject is prefixed with [TRANSLATED] for easy recognition.
  7. Add β€œTranslated Emails” Label

    • Automatically tags the original message in Gmail with β€œTranslated Emails”.
    • Helps you filter all auto-translated emails later.

πŸ› οΈ Setup Steps

1. Gmail Label

2. OpenAI API Key

3. Gmail OAuth


πŸ“§ Example Output

Subject: [TRANSLATED] Meeting Proposal

Body:
🌍 AUTO-TRANSLATED EMAIL (Original Language: ES) πŸ“§ Original From: juan@example.com πŸ“… Received: 2025-08-29 πŸ”— Message ID: 123456abcdef

═══════════════════════════════════════ TRANSLATED CONTENT:

Hello, I wanted to ask if we can schedule the meeting for next week.

═══════════════════════════════════════

✨ This email was automatically translated by n8n workflow.


⚑ With this workflow, every foreign-language email is instantly translated and delivered to you in English β€” no manual copy-pasting into Google Translate again.

πŸ”— Nodes Used

Gmail, Gmail Trigger, OpenAI

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup