{
  "name": "Voice translator bridge (Telegram → Slack) with GPT-4o-mini + Whisper",
  "nodes": [
    {
      "id": "92ef6daa-251b-4203-b7c3-aa64451e9973",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2192,
        -560
      ]
    },
    {
      "id": "46355ee1-472a-45b8-9a30-bd2661b2edf6",
      "name": "Is Voice?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1952,
        -560
      ]
    },
    {
      "id": "ff56e185-727a-4aed-af00-dbc583e62078",
      "name": "Get File ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -1760,
        -656
      ]
    },
    {
      "id": "714c4a56-f886-47a9-97bf-85099f70b35d",
      "name": "Telegram getFile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1440,
        -656
      ]
    },
    {
      "id": "8c523645-2952-45ce-9e3a-a3850084b858",
      "name": "Build File URL",
      "type": "n8n-nodes-base.function",
      "position": [
        -1184,
        -560
      ]
    },
    {
      "id": "00727b12-217a-4169-925d-f0988c608a3c",
      "name": "Download Voice File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        -560
      ]
    },
    {
      "id": "dc8c842b-675f-4423-a86b-358fa479c256",
      "name": "Extract Transcript",
      "type": "n8n-nodes-base.set",
      "position": [
        -2192,
        -320
      ]
    },
    {
      "id": "148b8a46-4a3a-4574-932e-ec84c3e01a8d",
      "name": "Detect Language",
      "type": "n8n-nodes-base.function",
      "position": [
        -1952,
        -320
      ]
    },
    {
      "id": "0096f37e-8157-46e5-af36-67c5397389a4",
      "name": "Translate (OpenAI)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1360,
        -320
      ]
    },
    {
      "id": "40a54c88-fed2-4388-a2ac-f1e824ecc900",
      "name": "Build Slack Message",
      "type": "n8n-nodes-base.function",
      "position": [
        -704,
        -320
      ]
    },
    {
      "id": "5c36ed2c-cf48-4162-abc4-9ed8c7dc6f0b",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        -320
      ]
    },
    {
      "id": "5c36c02a-46ac-4d67-bc28-de11f7c9f258",
      "name": "Add Bot Token",
      "type": "n8n-nodes-base.set",
      "position": [
        -1600,
        -560
      ]
    },
    {
      "id": "29bb8262-a2a3-4a28-a5b6-a8c4013a5179",
      "name": "Prepare Whisper Input1",
      "type": "n8n-nodes-base.code",
      "position": [
        -544,
        -560
      ]
    },
    {
      "id": "160f0494-e66c-4da0-8ae4-bfad272bfdc8",
      "name": "Transcribe a recording",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -240,
        -560
      ]
    },
    {
      "id": "9b9e59f1-67fe-42ba-88b5-3a7259d4340b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -976
      ],
      "parameters": {
        "width": null,
        "height": 416,
        "content": "### 🎯 Purpose  \nDownloads the actual `.oga` or `.mp3` file from Telegram.\n\n### ⚙️ Setup  \n- Method: `GET`\n- URL: `{{$json.file_url}}`\n- **Send Binary Data:** ✅ (ON)\n\n### 🧩 Output  \nBinary data under `"
      }
    },
    {
      "id": "c6ac3585-a699-4713-b816-00a05f735f3b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -976
      ],
      "parameters": {
        "width": 256,
        "height": 416,
        "content": "### 🎯 Purpose  \nConstructs the Telegram file URL for download.\n\n### ⚙️ Setup  \nUse an **Expression**:\n```\nhttps://api.telegram.org/file/bot{{$credentials.telegramApi.accessToken}}/{{$json.file_path}}\n"
      }
    },
    {
      "id": "475b3e8a-34f4-4687-b58e-7474792ec14f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2304,
        -944
      ],
      "parameters": {
        "width": 320,
        "height": 384,
        "content": "### 🎯 Purpose  \nStarts the workflow when a **voice message** is received in Telegram.\n\n### ⚙️ Setup  \n- Connect your **Telegram Bot Token** (Credential: `TELEGRAM_BOT_TOKEN`).\n- This node listens for "
      }
    },
    {
      "id": "c2ccfb01-1eae-4577-9cf8-bf5ebdb5c2db",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        -976
      ],
      "parameters": {
        "width": 416,
        "height": 320,
        "content": "### 🎯 Purpose  \nRetrieve the Telegram voice file's metadata.\n\n### ⚙️ Setup  \n- Input: `file_id` from the Trigger node  \n- Calls Telegram API `getFile` to obtain the `file_path`.\n\n### 🧩 Output  \n`file_"
      }
    },
    {
      "id": "23fca2a8-99ee-49b4-9129-dfc38e23225e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -976
      ],
      "parameters": {
        "width": 224,
        "height": 416,
        "content": "### 🎯 Purpose  \nPrepare binary audio data for the Whisper node.\n\n### ⚙️ Setup  \n- Input: `$binary.data`\n- Output: rename to `audio` (binary key expected by Whisper)\n\n### 🧩 Output  \nBinary → `$binary.a"
      }
    },
    {
      "id": "a762b0c7-2b17-4380-8947-cea69841b5ba",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -976
      ],
      "parameters": {
        "width": null,
        "height": 416,
        "content": "### 🎯 Purpose  \nConvert voice to text using **OpenAI Whisper**.\n\n### ⚙️ Setup  \n- Credential: `OPENAI_API_KEY_HEADER`\n- Resource: `Audio`\n- Operation: `Transcribe a Recording`\n- Input Data Field Name:"
      }
    },
    {
      "id": "eae1d9fa-9cec-4209-b7d8-f11246380512",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2032,
        -176
      ],
      "parameters": {
        "width": 272,
        "height": 432,
        "content": "### 🎯 Purpose  \nDetect source language from the transcription text.\n\n### ⚙️ Setup  \nSimple **IF or Code node** to detect “ja” vs “en”.  \nUsed later for flag direction (🇯🇵→🇺🇸 or 🇺🇸→🇯🇵)."
      }
    },
    {
      "id": "fb850072-380e-4b4a-bed1-d141814e7fe3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        -176
      ],
      "parameters": {
        "width": 688,
        "height": 624,
        "content": "### 🎯 Purpose  \nTranslate transcribed text using **GPT-4o-mini**.\n\n### ⚙️ Setup  \n- Request Method: POST  \n- URL: `https://api.openai.com/v1/chat/completions`  \n- Headers:\n  ```json\n  {\n    \"Authoriza"
      }
    },
    {
      "id": "c8bd3ff0-7181-4611-a1a8-c901fc62795f",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -176
      ],
      "parameters": {
        "width": 368,
        "height": 432,
        "content": "### 🎯 Purpose  \nFormats the translated message for Slack.\n\n### ⚙️ Example (Code node)\n```js\nconst src = $json.source_lang === 'ja' ? '🇯🇵' : '🇺🇸';\nconst dst = $json.target_lang === 'ja' ? '🇯🇵' : '🇺🇸';\n"
      }
    },
    {
      "id": "287d070d-c5df-458b-8c33-00c9b4215a03",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -176
      ],
      "parameters": {
        "width": 368,
        "height": 496,
        "content": "### 🎯 Purpose  \nPost the final translated message into Slack.\n\n### ⚙️ Setup  \n- Authentication: `Header Auth`  \n- Credential: `SLACK_BOT_TOKEN_HEADER`  \n- URL: `https://slack.com/api/chat.postMessage`"
      }
    }
  ],
  "connections": {
    "Is Voice?": {
      "main": [
        [
          {
            "node": "Get File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File ID": {
      "main": [
        [
          {
            "node": "Add Bot Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Bot Token": {
      "main": [
        [
          {
            "node": "Telegram getFile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build File URL": {
      "main": [
        [
          {
            "node": "Download Voice File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Language": {
      "main": [
        [
          {
            "node": "Translate (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Is Voice?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram getFile": {
      "main": [
        [
          {
            "node": "Build File URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Transcript": {
      "main": [
        [
          {
            "node": "Detect Language",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate (OpenAI)": {
      "main": [
        [
          {
            "node": "Build Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Slack Message": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Voice File": {
      "main": [
        [
          {
            "node": "Prepare Whisper Input1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Whisper Input1": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Extract Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}