n8n AI agent — Telegram integration
n8n is a workflow automation platform with AI agent nodes and a native Telegram trigger. Here's how the integration works — and when it stops being the right tool.
n8n is a fair-code workflow automation tool, often described as the open-source Zapier. Its AI agent nodes (added in 2024) let you wire an LLM into multi-step workflows, and the Telegram trigger node listens for incoming messages from a bot.
For simple use cases — a Telegram bot that calls an LLM and replies — n8n works well. The Telegram Trigger node receives the update, you pass the message to an AI Agent node, and the AI Agent's output goes to a Send Message node. The whole thing runs on every incoming message.
Where n8n becomes awkward is when you want stateful agent behavior: persistent memory across conversations, tool calls that branch unpredictably, pairing codes for unknown senders, or fine-grained per-chat permissions. n8n is a workflow engine, not an agent runtime.
Native Telegram support — honest assessment
First-class via the Telegram Trigger and Send Message nodes. Works out of the box with a bot token.
Workflow-shaped, not agent-shaped. Each message runs the workflow from scratch unless you add memory nodes. No native pairing code policy. No first-class skill format.
Hiregents runs the OpenClaw agent runtime designed for stateful conversational agents — persistent memory, tool calls, pairing codes, and the open SKILL.md format are native, not bolted on.
Setup guide — 5 steps
- 1
Set up n8n
Install n8n via Docker, npm, or use n8n Cloud. The self-hosted version is free; cloud starts at $20/mo.
- 2
Create a Telegram bot
Message @BotFather, /newbot, copy the token. Add a Telegram credential in n8n with the token.
- 3
Add the Telegram Trigger node
This webhook listens for incoming messages. n8n auto-registers the webhook with Telegram on activation.
- 4
Add an AI Agent node
Pick a model (OpenAI, Anthropic, etc.), give it a system prompt, and pass {{$json.message.text}} as input. Optionally add a Memory node for context retention.
- 5
Send the reply
Add a Telegram Send Message node, set chatId to {{$json.message.chat.id}} and text to the AI Agent output. Activate the workflow.
Skip the setup — deploy in 5 minutes
Hiregents handles the server, security, encryption, and updates. You bring a bot token and an OpenRouter key.
Deploy on HiregentsSelf-host vs Hiregents
| Feature | Self-host n8n | Hiregents |
|---|---|---|
| Agent format | n8n workflow JSON (proprietary) | Open SKILL.md (Anthropic standard) |
| Conversation memory | Add Memory node manually per workflow | Built into the agent runtime |
| Tool calling | Wire each tool as a separate node | SKILL.md declares tools, runtime handles dispatch |
| Pairing codes | Build it yourself | Built in |
| Best for | Multi-step automations across many SaaS tools | Stateful conversational agents on Telegram |
| Hosting | Self-host or n8n Cloud (shared) | Private dedicated server per agent |
FAQ
Can n8n be used as a Telegram AI agent?
Yes. n8n has a Telegram Trigger node and AI Agent node. For simple request-reply bots, this works well. For agents that need persistent memory, complex tool dispatch, or per-user access control, a purpose-built agent runtime like OpenClaw (used by Hiregents) is a better fit.
n8n vs Hiregents for Telegram bots — which should I pick?
Pick n8n if you're orchestrating workflows across many tools (Gmail, Notion, Sheets) and Telegram is just one trigger. Pick Hiregents if Telegram is the primary channel and the agent itself needs to be stateful, with memory, tools, and access control built in.
Is n8n free?
n8n is fair-code licensed (free to self-host). n8n Cloud starts at $20/mo. AI model usage is billed separately by the provider you connect.