ClaudeCreativeVideoAI score · 74/100AI-assisted edit · no obvious prompt-injection riskn8n.io

n8n Multimodal Telegram Bot: Voice, Image & Video Analysis

Input: Telegram message (voice/picture/video/text) → Process: n8n workflow routes by type, extracts media, transcribes or analyzes, merges into unified input, AI Agent generates reply → Output: Telegram text message

Some experienceStepsWorkflowPromptTip
Who
Users who want to build a Telegram AI agent in n8n
You get
Bot receives and understands voice, image, video, and text messages, returning AI-generated text replies
You need
n8n · telegram · google-gemini

Constraints

Prerequisites: Telegram bot access token; OpenAI API key (voice transcription); Google Gemini API key (image and video analysis); Anthropic API key (chat model); n8n instance (Cloud or self-hosted). Costs depend on actual API usage; source does not provide specific pricing.

What they did

Author keithuy published this workflow template on the n8n official template gallery. The template receives messages via Telegram Trigger, routes by type using a Switch node, transcribes voice with OpenAI Whisper, analyzes images and video with Google Gemini, and generates replies via an Anthropic Claude-powered AI Agent sent back through Telegram.

How it went

The source does not report specific runtime test results or user feedback. The template is positioned as a 'starting point'; the author suggests users add more tools to expand capabilities.

Worth knowing

The system prompt enforces plain text output to prevent JSON or code blocks from breaking Telegram display. Simple Memory isolates sessions by chat ID with a preset contextWindowLength of 50. Both video and image analysis use the Gemini 2.5 Flash model. The workflow is marked active=true, but this site has not tested it. Credential types: telegramApi, openAiApi, anthropicApi, googlePalmApi (used by the Gemini node).

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Telegram Trigger node: connect Telegram API credentials.
  • Transcribe a recording node: connect OpenAI API credentials.
  • Anthropic Chat Model node: connect Anthropic API credentials.
  • Send Regular Message node: connect Telegram API credentials.
  • Get a Audio File node: connect Telegram API credentials.
  • Get a Photo node: connect Telegram API credentials.
  • Get a Video File node: connect Telegram API credentials.
  • Analyze video node: connect Google Gemini/PaLM API credentials.
  • Analyze an image node: connect Google Gemini/PaLM API credentials.

Configuration to replace

  • Source template is n8n public workflow #9008 (~31 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Create Telegram bot and configure credentials

    In Telegram, search for @BotFather, send /newbot, follow the prompts to create a bot, and copy the access token. In n8n, open the Telegram Trigger node, create a telegramApi credential, paste the token, and save.

  2. Add LLM credentials

    In n8n's LLM nodes, add the required credentials: OpenAI (voice transcription), Google Gemini (image and video analysis), and Anthropic (AI Agent chat model). Select the models and ensure each account has credits.

  3. Import workflow and verify message routing

    Import the template workflow. Confirm the Telegram Trigger node listens for message updates. The Switch node branches into five paths: /start command goes to No Operation, while voice, picture, video, and text each enter their respective processing branches.

  4. Configure media processing branches

    Voice branch: Get a Audio File node fetches the voice file by file_id, then Transcribe a recording (OpenAI) converts it to text. Picture branch: Get a Photo node fetches the image, then Analyze an image (Gemini) processes it. Video branch: Get a Video File node fetches the video, then Analyze video (Gemini) processes it. All branch outputs flow into the Merge node.

    Execution prompt · Source text。Analyze video node text parameter (expression)

    ={{ $('Telegram Trigger').item.json.message.caption || $('Telegram Trigger').item.json.message.text }}
  5. Set AI Agent system prompt and model

    The AI Agent node uses define prompt mode. Set systemMessage to the source-provided system prompt to ensure plain UTF-8 string output. In the Anthropic Chat Model node, select claude-sonnet-4-20250514 with maxTokensToSample set to 10000.

    Execution prompt · Source text。AI Agent node systemMessage field

    You are a helpful, intelligent assistant.
    
    Output ONLY a plain UTF-8 string for Telegram. 
    No JSON. No code fences. No prefaces. 
    If content is empty, output "…".
  6. Configure memory and optional tools

    In the Simple Memory node, set sessionKey to the Telegram chat ID ({{ $('Telegram Trigger').item.json.message.chat.id }}) and contextWindowLength to 50, so the AI Agent retains conversation context per chat. The Date & Time tool can be attached as an optional tool for the AI Agent.

  7. Activate and test

    Save and activate the workflow. Send voice, image, video, or text messages to your bot in Telegram and verify each branch processes correctly and returns an AI reply. If no reply is received, check the n8n execution log for credential errors or node failures.

Prompt you can copy

Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

Please build a multimodal Telegram AI bot using the following n8n workflow template. First confirm you have ready: a Telegram bot token, OpenAI API key, Google Gemini API key, Anthropic API key, and an available n8n instance. Then follow the steps to configure credentials, import the workflow, verify Switch routing, set the AI Agent system prompt, and finally activate and test.

Before building, confirm all four API credentials are ready and your n8n instance can access the internet to receive Telegram webhooks.

Source

Multimodal telegram bot with voice, image & video analysis using Claude & Gemini · keithuy · n8n.io · 2025-09-27

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related