Answer Telegram customer messages with Ollama, OpenAI, or Anthropic
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This workflow has 9 nodes and runs on Telegram events (message). Along the way it connects Telegram.
How it runs
Trigger: On Telegram events (message).
- Set AI Configuration (Edit Fields (Set)): sets 9 fields: ai_provider, ai_model, ollama_url…
- Prepare Conversation Data (Code): runs custom JavaScript code
- Construct AI Request (Code): runs custom JavaScript code
- Post to AI API (HTTP Request): calls an HTTP API (POST)
- Parse AI Response (Code): runs custom JavaScript code
- Notify of Delayed Response (Telegram): uses Telegram
- Reply with AI Answer (Telegram): uses Telegram
- Record Conversation Turn (Code): runs custom JavaScript code
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Check at runtime on n8n 3.0
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (5)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Telegram
n8n-nodes-base.telegram
From the author
Quick overview This workflow replies to incoming Telegram bot messages using an Ollama, OpenAI, or Anthropic chat model constrained by your business notes, and falls back to a predefined message when it can’t answer or the AI call fails. How it works 1.…