n8n AI Agent Tutorial 2026: Build a Telegram Support Bot with n8n (199k Stars) + Ollama in 30 Minutes - No Code
n8n (199,396 stars) is the most popular self-hosted workflow automation platform - this tutorial builds a working Telegram AI support bot with n8n + Ollama (177,825 stars) in 30 minutes, no code.
💡 What You Will Learn
n8n (199,396 stars) is the most popular self-hosted workflow automation platform - this tutorial builds a working Telegram AI support bot with n8n + Ollama (177,825 stars) in 30 minutes, no code.
📜 Table of Contents
The short answer
n8n (199,396 stars) is a visual workflow automation tool with native AI Agent nodes. You connect triggers (Telegram message, webhook, email) to an AI Agent node backed by Ollama (177,825 stars) or any LLM - and the agent can call tools like HTTP requests, database lookups, or other workflows.
Step 1 - Install n8n
docker run -d -p 5678:5678 -v n8n_data:/home/node/.n8n --name n8n n8nio/n8n
Open http://localhost:5678 and create an account (local, no cloud required).
Step 2 - Get a Telegram bot token
Message @BotFather on Telegram: /newbot - choose a name - copy the token.
Step 3 - Build the workflow (visual, ~15 min)
- Add Telegram Trigger node, paste the token, select "message" event.
- Add AI Agent node:
- Language Model: Ollama, model
qwen2.5:7b - System prompt: "You are a support assistant for Acme Corp. Be concise and helpful."
- Tools: add a "Wikipedia" or "HTTP Request" tool so the agent can look things up.
- Add Telegram node (respond), wire: Trigger - Agent - Respond.
- Activate the workflow. Test: message your bot.
Making it production-ready
- Add a Memory node (e.g., Redis) so the bot remembers conversations.
- Add an error branch: if the LLM call fails, reply with a fallback message.
- Add rate limiting per user ID to prevent abuse.
Real numbers
- n8n has 400+ integrations and 100k+ self-hosted deployments.
- A Telegram + Ollama bot runs on a $5 VPS; Ollama needs ~8GB RAM for a 7B model.
- Response time on a 16GB machine with 7B model: ~2-5 seconds per message.
FAQ
Q: Do I need to know Python? A: No - everything is drag-and-drop. Custom logic can be added with a Code node if needed.
Q: Can it call external APIs? A: Yes - the AI Agent's tools include HTTP Request, so the agent can query your own APIs mid-conversation.
Q: What about webhooks instead of Telegram? A: Same pattern - swap the trigger for a Webhook node and you have an API chatbot.
❓ FAQ
Do I need to know Python?
No - everything is drag-and-drop. Custom logic can be added with a Code node if needed.
Can it call external APIs?
Yes - the AI Agent's tools include HTTP Request, so the agent can query your own APIs mid-conversation.
What about webhooks instead of Telegram?
Same pattern - swap the trigger for a Webhook node and you have an API chatbot.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only โ no paid placements.
