AutomationFlowsAI & RAG › Multilingual Voice & Text Telegram Bot with Elevenlabs Tts and Langchain Agents

Multilingual Voice & Text Telegram Bot with Elevenlabs Tts and Langchain Agents

ByIvanCore @ivancore on n8n.io

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Event trigger★★★★☆ complexityAI-powered18 nodesTelegram TriggerTelegram@Elevenlabs/N8N Nodes ElevenlabsGoogle Gemini ChatGroq ChatAgentHTTP RequestMemory Buffer Window
AI & RAG Trigger: Event Nodes: 18 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #5511 — we link there as the canonical source.

This workflow follows the Agent → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "83497222-5524-4f63-9e45-b1bfe3397de1",
      "name": "Telegram Input",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1680,
        -60
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "743ec068-df01-4bcb-89a4-499da2de1c58",
      "name": "Adds SessionId",
      "type": "n8n-nodes-base.set",
      "position": [
        -1500,
        -60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b5c25cd4-226b-4778-863f-79b13b4a5202",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.message.chat.id }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "9bbb8ed4-2458-4072-98bc-ccde13b80af0",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1320,
        -60
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "voice",
              "conditions": {
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a2869917-6c2d-4fe6-b3bb-68fb1f4447f8",
                    "operator": {
                      "type": "string",
                      "operation": "empty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "text",
              "conditions": {
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ba8aa838-8f6e-41dc-ab08-d44b444b3c5d",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "a5e0c4a8-041e-4252-8a77-7f090e565a5c",
      "name": "Get Voice File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1120,
        -160
      ],
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.1
    },
    {
      "id": "3fe6c7c4-28ee-4bdb-9db6-67fd4b486b64",
      "name": "Transcribe ElevenLabs",
      "type": "@elevenlabs/n8n-nodes-elevenlabs.elevenLabs",
      "position": [
        -980,
        -160
      ],
      "parameters": {
        "resource": "speech",
        "operation": "speechToText",
        "requestOptions": {},
        "additionalOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "c8520675-e456-4ac6-9959-81068c371bd4",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -840,
        -160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "069636d6-2929-4044-8174-905689ef726d",
              "name": "message.text",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "721a7962-d198-485f-8c9f-3e962d83db5f",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $('Switch').item.json.sessionId }}"
            },
            {
              "id": "0f39588e-55eb-4bf3-9150-456c6597100c",
              "name": "voice",
              "type": "boolean",
              "value": true
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3eb68b11-1cca-4d03-ba1a-8f4e81199148",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -620,
        -60
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "5f477900-a311-4b6e-ba2c-7a5460937978",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -720,
        200
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "4948f23a-ddde-4973-963c-cfe1aec5119a",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -560,
        200
      ],
      "parameters": {
        "model": "deepseek-r1-distill-llama-70b",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "dddd3d08-b63c-4a64-9def-e694ca2efd47",
      "name": "Voice Assistant",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -420,
        -60
      ],
      "parameters": {
        "text": "={{ $json.data[0].message.text }}",
        "options": {
          "systemMessage": "You are the woman **CoinMarketCap AI Data Analyst**, a powerful, multi-source crypto intelligence system that integrates three specialized agents..."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "b459ce91-2261-4fc4-8cc0-8e39d2093512",
      "name": "If voice",
      "type": "n8n-nodes-base.if",
      "position": [
        -60,
        -60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "combinator": "and",
          "conditions": [
            {
              "id": "290be484-45fd-497f-917e-00df36476bf2",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Aggregate').item.json.data[0].voice }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "73d99c4c-c968-44ef-9196-94e5b372051c",
      "name": "ElevenLabs",
      "type": "@elevenlabs/n8n-nodes-elevenlabs.elevenLabs",
      "position": [
        160,
        -160
      ],
      "parameters": {
        "text": "={{ $('Voice Assistant').item.json.output }}",
        "voice": {
          "mode": "list",
          "value": "9BWtsMINqrJLrRacOk9x",
          "cachedResultName": "Aria"
        },
        "resource": "speech",
        "requestOptions": {},
        "additionalOptions": {
          "model": {
            "mode": "list",
            "value": "eleven_multilingual_v2"
          },
          "languageCode": "={{ $('Telegram Input').item.json.message.from.language_code }}",
          "outputFormat": "opus_48000_64"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4b661df9-08fc-498f-ae5f-945956120287",
      "name": "Telegram Send Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        160,
        20
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Input').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "b68da635-54b8-4c42-8c72-2b12cc805b12",
      "name": "Telegram send voice message",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        380,
        -160
      ],
      "parameters": {
        "url": "https://api.telegram.org/bot{{$credentials.telegramToken}}/sendVoice",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "chat_id",
              "value": "={{ $('Telegram Input').item.json.message.chat.id }}"
            },
            {
              "name": "voice",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "multipart/form-data"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "420ec75a-87e4-4d29-b4b7-81299cc42760",
      "name": "Voice Assistant Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -420,
        200
      ],
      "parameters": {
        "sessionKey": "={{ $json.data[0].sessionId }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "73674764-4bfd-4fc1-91ad-42ad03aae79d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -300
      ],
      "parameters": {
        "width": 300,
        "height": 180,
        "content": "**Auto-language detection**:  \n- Uses `message.from.language_code` (e.g., \"ru\", \"es\")  \n- Ensure ElevenLabs model = `eleven_multilingual_v2`  \n- Override with `languageCode` in TTS node if needed  "
      },
      "typeVersion": 1
    },
    {
      "id": "6a439698-ca32-4188-a6ba-ac427cf995eb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1400,
        120
      ],
      "parameters": {
        "width": 300,
        "height": 300,
        "content": "\ud83c\udf99\ufe0f Voice/Text Routing Logic\n\n**How messages are processed:**\n\n- **Voice Message Path:**\n  1. Get voice file \u2192 ElevenLabs STT \u2192 Set `voice=true` flag\n  2. AI processes text \u2192 ElevenLabs TTS \u2192 Send voice reply\n\n- **Text Message Path:**\n  1. Bypass STT/TTS \u2192 Direct to AI\n  2. Send text reply\n\n*Switch node uses:*\n`={{ $json.message.text }}` empty check"
      },
      "typeVersion": 1
    },
    {
      "id": "d12487ce-023d-468d-9204-ebf4d86df3d8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        140
      ],
      "parameters": {
        "width": 380,
        "height": 440,
        "content": "## \ud83d\udee0\ufe0f Custom Tools Integration\n\n**To add your own tools:**\n1. Edit `systemMessage` in Voice Assistant node\n2. Add tool descriptions in format:\n```python\nTool(\n    name=\\\"YourTool\\\",\n    func=tool_function,\n    description=\\\"What it does\\\"\n)\n```\n\n**Example tools:**\n- Database queries\n- API integrations\n- Math/code executors\n\n*Connect required nodes to fetch data"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Get Voice File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If voice": {
      "main": [
        [
          {
            "node": "ElevenLabs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram Send Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Voice Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ElevenLabs": {
      "main": [
        [
          {
            "node": "Telegram send voice message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adds SessionId": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Voice File": {
      "main": [
        [
          {
            "node": "Transcribe ElevenLabs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        []
      ]
    },
    "Voice Assistant": {
      "main": [
        [
          {
            "node": "If voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe ElevenLabs": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Voice Assistant Memory": {
      "ai_memory": [
        [
          {
            "node": "Voice Assistant",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Voice Assistant",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Source: https://n8n.io/workflows/5511/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.

OpenAI Chat, Memory Buffer Window, Output Parser Structured +11
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14
AI & RAG

Telegram Bot. Uses agent, memoryBufferWindow, telegram, @elevenlabs/n8n-nodes-elevenlabs. Event-driven trigger; 41 nodes.

Agent, Memory Buffer Window, Telegram +5
AI & RAG

Multi-modal AI Image Generator powered by Google's Nano Banana (Gemini 2.5 Flash Image)* - the latest state-of-the-art image generation model Accepts text, images, voice messages, and PDFs via Telegra

OpenAI, HTTP Request, Telegram +5
AI & RAG

This n8n workflow template creates an intelligent stock technical analysis system that delivers professional-grade trading signals directly to your Telegram. Designed for retail traders, investors, an

HTTP Request, Output Parser Structured, Memory Buffer Window +4