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.
## 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
```bash
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)
1. Add **Telegram Trigger** node, paste the token, select "message" event.
2. 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.
3. Add **Telegram** node (respond), wire: Trigger - Agent - Respond.
4. 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.
Related Articles
2026-06-29
The Mainline Dragon Strategy โ Chasing the Leader Without Paying for Data
2026-06-29
The AI Hiding in Your Laptop
2026-07-14
Free AI Coding Assistant Setup 2026: 5-Min VS Code Guide (Continue, Copilot, Windsurf)
