{
  "name": "Auto-translate incoming Gmail emails to English with OpenAI GPT-3.5",
  "nodes": [
    {
      "id": "20d9e7a4-52a6-42d4-8e30-640cf2bcb6dd",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        16
      ],
      "parameters": {
        "width": 280,
        "height": 520,
        "content": "🌍 **SETUP REQUIRED:**\n\n1. **Gmail Label:**\n   - Create label: 'Translated Emails'\n   - Or customize in final Gmail node\n\n2. **OpenAI API Key:**\n   - Get from platform.openai.com\n   - Add to n8n creden"
      }
    },
    {
      "id": "c2eff161-87e1-42b4-bb00-364a5b448c9f",
      "name": "Gmail New Email Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -48,
        240
      ]
    },
    {
      "id": "9c6427cc-261a-43af-a4aa-97ceba914d42",
      "name": "Normalize Email Data",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        240
      ]
    },
    {
      "id": "e153e8ca-38ab-48cb-be2f-cdba1cca6faf",
      "name": "Detect Language (OpenAI)",
      "type": "n8n-nodes-base.openAi",
      "position": [
        352,
        240
      ]
    },
    {
      "id": "ebc6660f-0a30-4c23-be79-1d2f8cbfddbd",
      "name": "Need Translation?",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        240
      ]
    },
    {
      "id": "18108511-b253-4bba-9efb-c3cfe4f71090",
      "name": "Translate to English",
      "type": "n8n-nodes-base.openAi",
      "position": [
        752,
        144
      ]
    },
    {
      "id": "ce532d8a-6cbc-4320-8cb1-a82a28126a14",
      "name": "Prepare Translated Email",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        144
      ]
    },
    {
      "id": "b2b30041-80a7-4b55-b594-0d717f365b09",
      "name": "Send Translated Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1152,
        144
      ]
    },
    {
      "id": "7e9513fa-ce63-4815-b0a5-a05b622581d7",
      "name": "Add 'Translated' Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1152,
        256
      ]
    }
  ],
  "connections": {
    "Need Translation?": {
      "main": [
        [
          {
            "node": "Translate to English",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Email Data": {
      "main": [
        [
          {
            "node": "Detect Language (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate to English": {
      "main": [
        [
          {
            "node": "Prepare Translated Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail New Email Trigger": {
      "main": [
        [
          {
            "node": "Normalize Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Language (OpenAI)": {
      "main": [
        [
          {
            "node": "Need Translation?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Translated Email": {
      "main": [
        [
          {
            "node": "Send Translated Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add 'Translated' Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}