{
  "id": "E9uHD7LTZmehWToP",
  "name": "Translate documents to multiple languages with Google Drive and DeepL",
  "tags": [],
  "nodes": [
    {
      "id": "83cdf376-b378-4a69-926d-29790f0c5053",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        384,
        240
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SOURCE_FOLDER_ID_HERE"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5a1fd22d-b09a-4bfc-8260-557ea3ccf7c1",
      "name": "Configuration (Edit Here)",
      "type": "n8n-nodes-base.set",
      "notes": "\u7ffb\u8a33\u5148\u8a00\u8a9e\u3001\u30d5\u30a9\u30eb\u30c0ID\u3001\u901a\u77e5\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u3053\u3053\u3067\u8a2d\u5b9a",
      "position": [
        608,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "source_folder_id",
              "name": "sourceFolderId",
              "type": "string",
              "value": "YOUR_SOURCE_FOLDER_ID_HERE"
            },
            {
              "id": "destination_folder_id",
              "name": "destinationFolderId",
              "type": "string",
              "value": "YOUR_DESTINATION_FOLDER_ID_HERE"
            },
            {
              "id": "target_languages",
              "name": "targetLanguages",
              "type": "array",
              "value": "=[\"EN\", \"ZH\", \"KO\", \"ES\", \"FR\", \"DE\"]"
            },
            {
              "id": "notification_email",
              "name": "notificationEmail",
              "type": "string",
              "value": "user@example.com"
            },
            {
              "id": "enable_notion",
              "name": "enableNotion",
              "type": "boolean",
              "value": "=false"
            },
            {
              "id": "notion_database_id",
              "name": "notionDatabaseId",
              "type": "string",
              "value": "YOUR_NOTION_DATABASE_ID_HERE"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ae46edbf-2890-46e1-b771-96e3b869b95e",
      "name": "Detect File Format",
      "type": "n8n-nodes-base.switch",
      "position": [
        1040,
        224
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "PDF",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "pdf_check",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.mimeType }}",
                    "rightValue": "application/pdf"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "DOCX",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "or",
                "conditions": [
                  {
                    "id": "docx_check",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.mimeType }}",
                    "rightValue": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
                  },
                  {
                    "id": "gdoc_check",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.mimeType }}",
                    "rightValue": "application/vnd.google-apps.document"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "TXT",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "txt_check",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.mimeType }}",
                    "rightValue": "text/plain"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Markdown",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "or",
                "conditions": [
                  {
                    "id": "md_check",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.mimeType }}",
                    "rightValue": "text/markdown"
                  },
                  {
                    "id": "md_ext_check",
                    "operator": {
                      "type": "string",
                      "operation": "endsWith"
                    },
                    "leftValue": "={{ $json.name }}",
                    "rightValue": ".md"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "2c694bdd-9d2c-4812-998f-ec9f02840a03",
      "name": "Download PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        96
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {}
          }
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "bc2dbb61-1fa5-47f9-a31c-64271a3c2566",
      "name": "Download DOCX",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        240
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {}
          }
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "4a72a576-533f-4ebb-bacf-1bb320e3fb37",
      "name": "Download TXT",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        384
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "9aee4e13-7167-4ec3-a58e-2cb4335304a1",
      "name": "Download Markdown",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1280,
        544
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "acce4e6b-5e61-47e2-bce0-9ab7e3ada23e",
      "name": "Extract Text from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        96
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "b53b7314-5093-48ef-abf8-5dcf95671b03",
      "name": "Extract Text from DOCX",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        240
      ],
      "parameters": {
        "options": {},
        "operation": "text",
        "destinationKey": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "a5a5fb92-b2d0-4e54-90d8-ea3b8774e9ea",
      "name": "Format Text Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1728,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "extracted_text",
              "name": "extractedText",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "original_filename",
              "name": "originalFilename",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "file_extension",
              "name": "fileExtension",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "da59a266-c54d-4465-8861-e0a9a0653c58",
              "name": "targetLanguages",
              "type": "array",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "a89d12ba-2143-483a-95b2-3478e4b9aa98",
              "name": "destinationFolderId",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "d3252026-1b16-4ebd-a3d0-8c69bc4c8cbb",
              "name": "notificationEmail",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "e75b9594-07de-456d-84ca-305b051a0574",
              "name": "enableNotion",
              "type": "boolean",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "a79fefa4-8682-4919-b3ed-b2d4c07fdf4c",
              "name": "notionDatabaseId",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.3
    },
    {
      "id": "558fedb8-9449-45cc-a33c-d55801b585e2",
      "name": "Split by Language",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1936,
        240
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "=targetLanguages"
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "dae4d4f7-9246-4797-bb73-52aea5aef0aa",
      "name": "Generate Filename",
      "type": "n8n-nodes-base.set",
      "position": [
        2384,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "translated_text",
              "name": "translatedText",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "language_code",
              "name": "languageCode",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            },
            {
              "id": "new_filename",
              "name": "newFilename",
              "type": "string",
              "value": "YOUR_FOLDER_ID_HERE"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "2b2331bc-4f3f-4cee-9fa0-0a5c33ace38f",
      "name": "Create Translated File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        2816,
        224
      ],
      "parameters": {
        "options": {},
        "fileName": "={{ $json.newFilename }}",
        "dataPropertyName": "=data"
      },
      "typeVersion": 1
    },
    {
      "id": "4d893749-ce0a-404c-ad21-aef61c3183dd",
      "name": "Save to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3040,
        224
      ],
      "parameters": {
        "name": "={{ $json.newFilename }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_FOLDER_ID_HERE"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_FOLDER_ID_HERE",
          "cachedResultName": "\u7ffb\u8a33\u6e08\u307f"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "de276bf8-db41-4ee9-89a8-12a7a986fdd4",
      "name": "Check if Notion Enabled",
      "type": "n8n-nodes-base.if",
      "position": [
        3264,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "notion_enabled",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.enableNotion }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c1498c5a-fd1a-4d61-a5e5-5433cc88dabc",
      "name": "Record in Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        3488,
        96
      ],
      "parameters": {
        "title": "={{ $json.originalFilename }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_FOLDER_ID_HERE"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "=={{ $json.originalFilename }}"
            },
            {
              "key": "=={{ $json.languageCode }}"
            },
            {
              "key": "=={{ $now.toISO() }}"
            },
            {
              "key": "=={{ $json.webViewLink }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ae061349-3976-44bb-81f8-a7ae53b283f9",
      "name": "Merge Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        3744,
        224
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "mergeByPosition"
      },
      "typeVersion": 2.1
    },
    {
      "id": "bce4bc57-8a20-4b53-b470-c8fe0df34d33",
      "name": "Aggregate Translations",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3936,
        224
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "a4898c8f-8fdc-4374-b8e4-eb0e1870bdb1",
      "name": "Prepare Notification",
      "type": "n8n-nodes-base.set",
      "position": [
        4128,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "summary",
              "name": "summary",
              "type": "object",
              "value": {
                "timestamp": "={{ $now.toISO() }}",
                "originalFile": "={{ $('\u30c6\u30ad\u30b9\u30c8\u6574\u5f62').item.json.originalFilename }}",
                "totalTranslations": "={{ $('\u8a2d\u5b9a\uff08\u3053\u3053\u3092\u7de8\u96c6\uff09').item.json.targetLanguages.length }}",
                "translatedLanguages": "={{ $('\u8a2d\u5b9a\uff08\u3053\u3053\u3092\u7de8\u96c6\uff09').item.json.targetLanguages }}"
              }
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "afb71078-f6ce-487d-b096-11bafbbfa533",
      "name": "Send Gmail Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        4320,
        224
      ],
      "parameters": {
        "sendTo": "=\u5909\u66f4\u5f8c: {{ $('\u8a2d\u5b9a\uff08\u3053\u3053\u3092\u7de8\u96c6\uff09').item.json.notificationEmail }}",
        "message": "=<h2>\ud83c\udf89 \u7ffb\u8a33\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\uff01</h2>\n\n<p><strong>\u5143\u30d5\u30a1\u30a4\u30eb:</strong> {{ $('\u901a\u77e5\u5185\u5bb9\u6e96\u5099').item.json.summary.originalFile }}</p>\n<p><strong>\u7ffb\u8a33\u3057\u305f\u8a00\u8a9e:</strong> {{ $('\u901a\u77e5\u5185\u5bb9\u6e96\u5099').item.json.summary.translatedLanguages.join(', ') }}</p>\n<p><strong>\u5408\u8a08\u7ffb\u8a33\u6570:</strong> {{ $('\u901a\u77e5\u5185\u5bb9\u6e96\u5099').item.json.summary.totalTranslations }}\u4ef6</p>\n<p><strong>\u7ffb\u8a33\u65e5\u6642:</strong> {{ $('\u901a\u77e5\u5185\u5bb9\u6e96\u5099').item.json.summary.timestamp }}</p>\n\n<p>\u7ffb\u8a33\u6e08\u307f\u30d5\u30a1\u30a4\u30eb\u306fGoogle Drive\u306e\u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002</p>",
        "options": {},
        "subject": "\u7ffb\u8a33\u5b8c\u4e86: {{ $json.summary.originalFile }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "982fd89f-4ad5-4f95-b8fd-4e3bb3834067",
      "name": "Error Handler",
      "type": "n8n-nodes-base.code",
      "disabled": true,
      "position": [
        2384,
        384
      ],
      "parameters": {
        "jsCode": "// \u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3068\u30ed\u30b0\u8a18\u9332\nconst errorInfo = {\n  timestamp: new Date().toISOString(),\n  error: $input.item.json.error || 'Unknown error',\n  fileName: $('Google Drive Trigger').item.json.name,\n  step: $node.name\n};\n\nconsole.error('Translation workflow error:', errorInfo);\n\nreturn { json: errorInfo };"
      },
      "typeVersion": 2
    },
    {
      "id": "347d3afa-5afc-47be-a5f1-d2e157016368",
      "name": "Send Error Notification",
      "type": "n8n-nodes-base.gmail",
      "disabled": true,
      "position": [
        2608,
        384
      ],
      "parameters": {
        "sendTo": "={{ $('\u8a2d\u5b9a\uff08\u3053\u3053\u3092\u7de8\u96c6\uff09').item.json.notificationEmail }}",
        "message": "\u7ffb\u8a33\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\n\n\u30d5\u30a1\u30a4\u30eb: {{ $json.fileName }}\n\u30a8\u30e9\u30fc\u5185\u5bb9: {{ $json.error }}\n\u767a\u751f\u6642\u523b: {{ $json.timestamp }}",
        "options": {},
        "subject": "\u274c \u7ffb\u8a33\u30a8\u30e9\u30fc\u767a\u751f",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "c90b4bcf-596d-46e5-b699-8c674240d07b",
      "name": "Translate a language",
      "type": "n8n-nodes-base.deepL",
      "position": [
        2160,
        240
      ],
      "parameters": {
        "text": "={{ $('\u30c6\u30ad\u30b9\u30c8\u6574\u5f62').item.json.extractedText }}",
        "translateTo": "={{ $json.targetLanguages }}",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "71df147c-e32b-482d-b566-d571b278fb2f",
      "name": "Merge Configuration",
      "type": "n8n-nodes-base.merge",
      "position": [
        816,
        256
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "mergeByPosition"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d5caf454-8f37-4f92-a475-7f5739c9c138",
      "name": "Read Markdown File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        576
      ],
      "parameters": {
        "options": {},
        "operation": "text",
        "destinationKey": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "d5c8bef8-7b69-4e79-beae-a7e5184e1069",
      "name": "Read TXT File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1504,
        416
      ],
      "parameters": {
        "options": {},
        "operation": "text",
        "destinationKey": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "6b2e9567-aabb-4935-b712-ed697da1ec2b",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        2592,
        224
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// \u30c6\u30ad\u30b9\u30c8\u3092\u30d0\u30a4\u30ca\u30ea\u306b\u5909\u63db\nconst text = $input.item.json.translatedText;\nconst fileName = $input.item.json.newFilename;\nconst buffer = Buffer.from(text, 'utf-8');\n\n// JSON\u30c7\u30fc\u30bf\u3068\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u306e\u4e21\u65b9\u3092\u8fd4\u3059\nreturn {\n  json: {\n    ...$input.item.json,  // \u3059\u3079\u3066\u306eJSON\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5f15\u304d\u7d99\u3050\n    newFilename: fileName,\n    translatedText: text\n  },\n  binary: {\n    data: {\n      data: buffer,\n      mimeType: 'text/plain',\n      fileName: fileName\n    }\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "8a5557f5-95cf-424d-9e1f-39ce96de98a7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "notes": "# \ud83c\udf0d 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 types:\n\u2705 PDF\n\u2705 DOCX (Microsoft Word)\n\u2705 Google Docs\n\u2705 TXT\n\u2705 Markdown (.md)\n\n## How to set up:\n1. **Edit the \"Configuration (Edit Here)\" node** (yellow node below)\n   - Set your Google Drive folder IDs\n   - Choose target languages\n   - Set your notification email\n\n2. **Add credentials** for:\n   - Google Drive OAuth2\n   - DeepL API\n   - Gmail OAuth2\n   - Notion API (optional)\n\n3. **Activate the workflow** and upload a file!\n\n## Default target languages:\nEN, ZH, KO, ES, FR, DE (can be customized)\n\n## Output:\nTranslated files saved with language codes:\n- document_en.pdf\n- document_zh.pdf\n- document_ko.pdf\netc.\n\n## Note:\nDeepL free tier: 500,000 characters/month",
      "position": [
        -256,
        -272
      ],
      "parameters": {
        "width": 560,
        "height": 1064,
        "content": "# \ud83c\udf0d 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 types:\n\u2705 PDF\n\u2705 DOCX (Microsoft Word)\n\u2705 Google Docs\n\u2705 TXT\n\u2705 Markdown (.md)\n\n## How to set up:\n1. **Edit the \"Configuration (Edit Here)\" node** (yellow node below)\n   - Set your Google Drive folder IDs\n   - Choose target languages\n   - Set your notification email\n\n2. **Add credentials** for:\n   - Google Drive OAuth2\n   - DeepL API\n   - Gmail OAuth2\n   - Notion API (optional)\n\n3. **Activate the workflow** and upload a file!\n\n## Default target languages:\nEN, ZH, KO, ES, FR, DE (can be customized)\n\n## Output:\nTranslated files saved with language codes:\n- document_en.pdf\n- document_zh.pdf\n- document_ko.pdf\netc.\n\n## Note:\nDeepL free tier: 500,000 characters/month"
      },
      "typeVersion": 1
    },
    {
      "id": "348dcb93-7d41-4749-b6c2-ef5a58e024d8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "notes": "## 1\ufe0f\u20e3 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- Notion integration (optional)\n\nAll settings are in one place for easy setup!",
      "position": [
        896,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 256,
        "content": "## 2\ufe0f\u20e3 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 text extraction\n- DOCX: Structure-aware parsing\n- TXT/MD: Direct text reading"
      },
      "typeVersion": 1
    },
    {
      "id": "0a1a8c7c-2e8f-49df-95e7-6e1be44e45a4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "notes": "## 2\ufe0f\u20e3 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 text extraction\n- DOCX: Structure-aware parsing\n- TXT/MD: Direct text reading",
      "position": [
        480,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 328,
        "height": 200,
        "content": "## 1\ufe0f\u20e3 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- Notion integration (optional)\n\nAll settings are in one place for easy setup!"
      },
      "typeVersion": 1
    },
    {
      "id": "a6351ae3-f679-4135-b53c-06f631abe384",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "notes": "## 3\ufe0f\u20e3 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\nThis loop runs for all target languages in parallel.",
      "position": [
        1776,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 232,
        "content": "## 3\ufe0f\u20e3 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\nThis loop runs for all target languages in parallel."
      },
      "typeVersion": 1
    },
    {
      "id": "f2fd7b4b-e246-4cef-b3d9-bad0832e4a30",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "notes": "## 4\ufe0f\u20e3 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 database for tracking.",
      "position": [
        3856,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 216,
        "content": "## 4\ufe0f\u20e3 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 database for tracking."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5c4c2ad3-9250-46a9-99cd-1b44a4a68c14",
  "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
          }
        ]
      ]
    }
  }
}