AutomationFlowsAI & RAG › Reply to Telegram Voice Messages with Smallest.ai and Google Gemini

Reply to Telegram Voice Messages with Smallest.ai and Google Gemini

ByZain Khan @zain on n8n.io

This workflow listens for Telegram bot messages, detects voice audio, downloads the audio file, transcribes it with Smallest.ai, and uses a Google Gemini–powered AI agent to draft a helpful reply that is sent back to the same Telegram chat. Triggers when a new message is…

Event trigger★★★★☆ complexityAI-powered11 nodesTelegram TriggerN8N Nodes SmallestaiTelegramAgentGoogle Gemini ChatTelegram Tool
AI & RAG Trigger: Event Nodes: 11 Complexity: ★★★★☆ AI nodes: yes Added:

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

This workflow follows the Agent → Google Gemini Chat 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
{
  "id": "0tvv4VH9NhxXWpTz",
  "name": "Voice Messages to Text",
  "tags": [],
  "nodes": [
    {
      "id": "8693d0ac-e9bd-4e1b-993f-b154e4762c3b",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -352,
        48
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "df9e5591-5cd4-472b-9b1f-ad57415466db",
      "name": "Check if message is voice",
      "type": "n8n-nodes-base.if",
      "position": [
        -192,
        48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "aa586ff8-3081-40a2-acf2-223e4518ffbe",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.audio }}",
              "rightValue": "audio"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "09347777-db4a-45cc-af4d-01d90a75e412",
      "name": "Transcribe message",
      "type": "n8n-nodes-smallestai.smallestai",
      "position": [
        288,
        32
      ],
      "parameters": {
        "resource": "stt",
        "additionalOptions": {}
      },
      "credentials": {},
      "typeVersion": 1
    },
    {
      "id": "b919bccb-4c68-4d5b-ab59-b7afb1d216f8",
      "name": "Get audio message file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        80,
        32
      ],
      "parameters": {
        "fileId": "={{ $json.message.audio.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "1ce73659-d7da-4cc8-b9a9-998df09b676d",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        512,
        32
      ],
      "parameters": {
        "text": "=Transcription: {{ $json.transcription ?? '' }}\nChat id: {{ $('Telegram Trigger').item.json.message.chat.id }}",
        "options": {
          "systemMessage": "You are a helpful assistant processing a user's voice memo. Your job is to analyze the provided Transcription, generate a helpful response, and send it to the user by calling the \"reply\" tool.\n\nWhen you call the tool, you must pass the exact Chat ID provided, and you MUST format the \"Text\" argument exactly like this:\n\nWhat user is saying: [Insert the exact transcription text here]\n\nWhat you can reply (a suggestion): [Insert your concise and clear reply suggestion answering their request here]"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "9638bf7e-14f0-4ff1-9a7a-5da01471a3d9",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        512,
        224
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "be4112fe-4846-41b9-9039-17e0e22fc2ae",
      "name": "reply",
      "type": "n8n-nodes-base.telegramTool",
      "position": [
        736,
        208
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
        "chatId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Chat_ID', ``, 'string') }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0b924c98-2680-4ad2-a194-44cf5fc6c7d4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 320,
        "content": "## 2. Download & Transcribe"
      },
      "typeVersion": 1
    },
    {
      "id": "52057ab9-bc56-4e1b-bcdc-5ad7efc6cdce",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 320,
        "content": "## 1. Capture & Filter Inbound Audio\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fbfdb89c-24ca-4cd9-820e-3dc1ab0fe338",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -176
      ],
      "parameters": {
        "width": 464,
        "height": 592,
        "content": "## AI-Powered Telegram Voice Message Assistant\n\n### How it works\nThis workflow turns Telegram into an intelligent voice memo companion. When an inbound message hits the Telegram bot trigger, it validates if the payload contains an audio object. It then fetches the binary audio file from Telegram's servers and routes it directly to Smallest.ai for accurate speech-to-text processing. The resulting text is fed to a LangChain AI Agent running Google Gemini, which reads the transcription, drafts a clever reply suggestions layout, and automatically pings the user back using a native Telegram conversational tool.\n\n### Setup steps\n* Add your **Telegram Bot API Token** inside the Trigger, Audio Downloader, and Reply Tool nodes.\n* Connect your **Smallest.ai** API key credentials to the transcription node.\n* Link your **Google Gemini** API key account to fuel the underlying LangChain Chat Model.\n\n### Customization\nYou can completely rewrite the target system prompt parameters inside the **AI Agent** node if you want the bot to perform alternate tasks with your voice memos\u2014such as acting as a language translator, sorting actionable items into a task list, or saving formatting summaries out to an external notes database."
      },
      "typeVersion": 1
    },
    {
      "id": "3d2c91eb-d02b-432a-a649-67cc5df501a4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -64
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 448,
        "content": "## 3. Intelligent Response Loop"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "825a4607-8f60-4b4d-9839-6840cb07f3d4",
  "nodeGroups": [],
  "connections": {
    "reply": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Check if message is voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get audio message file": {
      "main": [
        [
          {
            "node": "Transcribe message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check if message is voice": {
      "main": [
        [
          {
            "node": "Get audio message file",
            "type": "main",
            "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 listens for Telegram bot messages, detects voice audio, downloads the audio file, transcribes it with Smallest.ai, and uses a Google Gemini–powered AI agent to draft a helpful reply that is sent back to the same Telegram chat. Triggers when a new message is…

Source: https://n8n.io/workflows/16815/ — 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

Transform your salon/service business with this streamlined Telegram automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I

Redis, Agent Tool, Google Calendar +10
AI & RAG

This workflow automates Facebook posting and appointment booking directly from a Telegram bot, making it especially useful for pet grooming businesses that want to keep their social media active while

Google Sheets, OpenAI Chat, Output Parser Structured +12
AI & RAG

Tired of chasing clients for signed NDAs and contracts? This workflow eliminates the email back-and-forth and lets your clients sign instantly inside Telegram. Faster deal flow → Cut signing time from

HTTP Request Tool, Telegram Trigger, Google Gemini Chat +4
AI & RAG

This workflow creates a multi-talented AI assistant named Simran that interacts with users via Telegram. It can handle text and voice messages, understand the user's intent, and perform various tasks.

MongoDB, Chain Llm, Google Gemini Chat +11
AI & RAG

Arvifund - Supabase (Fixed v6). Uses httpRequest, telegram, supabase, telegramTrigger. Event-driven trigger; 92 nodes.

HTTP Request, Telegram, Supabase +8