{
  "name": "Translate documents to multiple languages with Google Drive and DeepL",
  "nodes": [
    {
      "id": "83cdf376-b378-4a69-926d-29790f0c5053",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        384,
        240
      ]
    },
    {
      "id": "5a1fd22d-b09a-4bfc-8260-557ea3ccf7c1",
      "name": "Configuration (Edit Here)",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        320
      ]
    },
    {
      "id": "ae46edbf-2890-46e1-b771-96e3b869b95e",
      "name": "Detect File Format",
      "type": "n8n-nodes-base.switch",
      "position": [
        1040,
        224
      ]
    },
    {
      "id": "2c694bdd-9d2c-4812-998f-ec9f02840a03",
      "name": "Download PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        96
      ]
    },
    {
      "id": "bc2dbb61-1fa5-47f9-a31c-64271a3c2566",
      "name": "Download DOCX",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        240
      ]
    },
    {
      "id": "4a72a576-533f-4ebb-bacf-1bb320e3fb37",
      "name": "Download TXT",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        384
      ]
    },
    {
      "id": "9aee4e13-7167-4ec3-a58e-2cb4335304a1",
      "name": "Download Markdown",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        544
      ]
    },
    {
      "id": "acce4e6b-5e61-47e2-bce0-9ab7e3ada23e",
      "name": "Extract Text from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        96
      ]
    },
    {
      "id": "b53b7314-5093-48ef-abf8-5dcf95671b03",
      "name": "Extract Text from DOCX",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        240
      ]
    },
    {
      "id": "a5a5fb92-b2d0-4e54-90d8-ea3b8774e9ea",
      "name": "Format Text Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1728,
        240
      ]
    },
    {
      "id": "558fedb8-9449-45cc-a33c-d55801b585e2",
      "name": "Split by Language",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1936,
        240
      ]
    },
    {
      "id": "dae4d4f7-9246-4797-bb73-52aea5aef0aa",
      "name": "Generate Filename",
      "type": "n8n-nodes-base.set",
      "position": [
        2384,
        224
      ]
    },
    {
      "id": "2b2331bc-4f3f-4cee-9fa0-0a5c33ace38f",
      "name": "Create Translated File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        2816,
        224
      ]
    },
    {
      "id": "4d893749-ce0a-404c-ad21-aef61c3183dd",
      "name": "Save to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3040,
        224
      ]
    },
    {
      "id": "de276bf8-db41-4ee9-89a8-12a7a986fdd4",
      "name": "Check if Notion Enabled",
      "type": "n8n-nodes-base.if",
      "position": [
        3264,
        224
      ]
    },
    {
      "id": "c1498c5a-fd1a-4d61-a5e5-5433cc88dabc",
      "name": "Record in Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        3488,
        96
      ]
    },
    {
      "id": "ae061349-3976-44bb-81f8-a7ae53b283f9",
      "name": "Merge Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        3744,
        224
      ]
    },
    {
      "id": "bce4bc57-8a20-4b53-b470-c8fe0df34d33",
      "name": "Aggregate Translations",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3936,
        224
      ]
    },
    {
      "id": "a4898c8f-8fdc-4374-b8e4-eb0e1870bdb1",
      "name": "Prepare Notification",
      "type": "n8n-nodes-base.set",
      "position": [
        4128,
        224
      ]
    },
    {
      "id": "afb71078-f6ce-487d-b096-11bafbbfa533",
      "name": "Send Gmail Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        4320,
        224
      ]
    },
    {
      "id": "982fd89f-4ad5-4f95-b8fd-4e3bb3834067",
      "name": "Error Handler",
      "type": "n8n-nodes-base.code",
      "position": [
        2384,
        384
      ]
    },
    {
      "id": "347d3afa-5afc-47be-a5f1-d2e157016368",
      "name": "Send Error Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2608,
        384
      ]
    },
    {
      "id": "c90b4bcf-596d-46e5-b699-8c674240d07b",
      "name": "Translate a language",
      "type": "n8n-nodes-base.deepL",
      "position": [
        2160,
        240
      ]
    },
    {
      "id": "71df147c-e32b-482d-b566-d571b278fb2f",
      "name": "Merge Configuration",
      "type": "n8n-nodes-base.merge",
      "position": [
        816,
        256
      ]
    },
    {
      "id": "d5caf454-8f37-4f92-a475-7f5739c9c138",
      "name": "Read Markdown File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        576
      ]
    },
    {
      "id": "d5c8bef8-7b69-4e79-beae-a7e5184e1069",
      "name": "Read TXT File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        416
      ]
    },
    {
      "id": "6b2e9567-aabb-4935-b712-ed697da1ec2b",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        224
      ]
    },
    {
      "id": "8a5557f5-95cf-424d-9e1f-39ce96de98a7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -272
      ],
      "parameters": {
        "width": 560,
        "height": 1064,
        "content": "# 🌍 Multi-Language Document Translation Workflow\n\n## What this workflow does:\nAutomatically translates documents uploaded to Google Drive into multiple languages using DeepL API.\n\n## Supported file ty"
      }
    },
    {
      "id": "348dcb93-7d41-4749-b6c2-ef5a58e024d8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -64
      ],
      "parameters": {
        "width": 380,
        "height": 256,
        "content": "## 2️⃣ File Format Detection & Text Extraction\n\nDetects file type (PDF/DOCX/TXT/MD) and routes to appropriate extraction method.\n\nEach format requires different extraction logic:\n- PDF: OCR-enabled te"
      }
    },
    {
      "id": "0a1a8c7c-2e8f-49df-95e7-6e1be44e45a4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        480
      ],
      "parameters": {
        "width": 328,
        "height": 200,
        "content": "## 1️⃣ Configuration\n\n**EDIT THIS NODE** to customize:\n- Source folder ID (where to monitor)\n- Destination folder ID (where to save)\n- Target languages (default: 6 languages)\n- Notification email\n- No"
      }
    },
    {
      "id": "a6351ae3-f679-4135-b53c-06f631abe384",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        -32
      ],
      "parameters": {
        "width": 440,
        "height": 232,
        "content": "## 3️⃣ Translation Loop\n\nSplits into one item per language, then FOR EACH:\n1. Translates text with DeepL API\n2. Generates filename with language code\n3. Creates binary file\n4. Uploads to Google Drive\n"
      }
    },
    {
      "id": "f2fd7b4b-e246-4cef-b3d9-bad0832e4a30",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3856,
        -32
      ],
      "parameters": {
        "width": 380,
        "height": 216,
        "content": "## 4️⃣ Completion & Notification\n\nAfter all translations complete:\n1. Aggregates all results\n2. Prepares summary data\n3. Sends email notification\n\nOptional: Records translation history in Notion datab"
      }
    }
  ],
  "connections": {
    "Download PDF": {
      "main": [
        [
          {
            "node": "Extract Text from PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download TXT": {
      "main": [
        [
          {
            "node": "Read TXT File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download DOCX": {
      "main": [
        [
          {
            "node": "Extract Text from DOCX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Handler": {
      "main": [
        [
          {
            "node": "Send Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Results": {
      "main": [
        [
          {
            "node": "Aggregate Translations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read TXT File": {
      "main": [
        [
          {
            "node": "Format Text Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Text Data": {
      "main": [
        [
          {
            "node": "Split by Language",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record in Notion": {
      "main": [
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Markdown": {
      "main": [
        [
          {
            "node": "Read Markdown File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Filename": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split by Language": {
      "main": [
        [
          {
            "node": "Translate a language",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Create Translated File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect File Format": {
      "main": [
        [
          {
            "node": "Download PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download DOCX",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download TXT",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Markdown File": {
      "main": [
        [
          {
            "node": "Format Text Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Configuration": {
      "main": [
        [
          {
            "node": "Detect File Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Merge Configuration",
            "type": "main",
            "index": 0
          },
          {
            "node": "Configuration (Edit Here)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Notification": {
      "main": [
        [
          {
            "node": "Send Gmail Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Google Drive": {
      "main": [
        [
          {
            "node": "Check if Notion Enabled",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate a language": {
      "main": [
        [
          {
            "node": "Generate Filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF": {
      "main": [
        [
          {
            "node": "Format Text Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Translations": {
      "main": [
        [
          {
            "node": "Prepare Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Translated File": {
      "main": [
        [
          {
            "node": "Save to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from DOCX": {
      "main": [
        [
          {
            "node": "Format Text Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Notion Enabled": {
      "main": [
        [
          {
            "node": "Record in Notion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Configuration (Edit Here)": {
      "main": [
        [
          {
            "node": "Merge Configuration",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}