How to Build a Telegram Bot With n8n in 2026 (Including an AI Assistant) — Step by Step

Published · Last updated · By AziqDev · 8 min read

n8n has become one of the most popular ways to build automations without writing a full application — and Telegram is one of its best-supported apps. With a couple of nodes you can turn a Telegram bot into an AI assistant, a lead collector, an order notifier or an internal team tool. Here's how to set it up and what to watch out for.

The basic recipe: create a bot in @BotFather → add the token as a Telegram credential in n8n → start the workflow with a Telegram Trigger → do something (AI, Google Sheets, CRM) → reply with a Telegram node → activate the workflow. Your n8n needs a public HTTPS URL.

Step 1: Create the Bot and Get a Token

In Telegram, open @BotFather, send /newbot, pick a name and a username ending in "bot", and copy the token. Full walkthrough: how to create a Telegram bot.

Step 2: Add Telegram Credentials in n8n

In n8n, create a new Telegram API credential and paste the bot token. Keep it private — anyone with the token controls your bot.

Step 3: Start With the Telegram Trigger

Add a Telegram Trigger node and choose which updates to listen to (usually "message"). When you test or activate the workflow, n8n registers a webhook with Telegram so new messages start the workflow.

Important: Telegram must be able to reach your n8n instance over public HTTPS. n8n Cloud handles this; self-hosted n8n needs a domain with a valid certificate. And a bot can only have one webhook — if another tool or script uses the same bot, they'll fight over it.

Step 4: Reply With the Telegram Node

Add a Telegram node with the "Send Message" action. Use the chat ID from the trigger (message.chat.id) so the reply goes back to the same person, and write the text — static or built from earlier nodes.

Step 5: Add an AI Agent (Optional)

  1. Between trigger and reply, add n8n's AI Agent node.
  2. Connect a chat model (OpenAI or another provider) and a memory node keyed by chat ID, so the bot remembers the conversation.
  3. Give it instructions: your business, tone, what it may and may not answer.
  4. Optionally add tools — a Google Sheet of products, your FAQ, a calendar.
  5. Send the agent's output with the Telegram node.

Workflow Ideas

Common Problems and Fixes

ProblemFix
Trigger never firesMake sure n8n has a public HTTPS URL and the workflow is activated
Works in test, not when activeTest and production webhook URLs differ — activate the workflow and re-test
Stopped after another tool connectedOnly one webhook per bot — use a separate bot for each tool
No messages from groupsDisable privacy mode in BotFather and re-add the bot — see bot not responding fixes
Messages fail during big sendsPace messages to respect rate limits

n8n vs Zapier for Telegram

n8nZapier
Ease of useModerateEasiest
Logic and branchingVery flexibleSimpler
AI agentsStrong built-in AI nodesAvailable, less flexible
HostingCloud or self-hostedCloud only
Best forReal bots and complex workflowsSimple "send a Telegram message when…" zaps

Full comparison including Make: n8n vs Zapier vs Make.

Want an n8n + Telegram workflow — or a custom bot when n8n isn't enough? We build both, from AI assistants to order and lead automations.

When to Move Beyond n8n

n8n is excellent for automations and internal tools. For customer-facing bots with rich button menus, payments, catalogs, dashboards or thousands of users, a custom bot gives you better control, speed and costs. Compare options in Telegram bot builders vs custom bots.

The Bottom Line

With n8n you can build a working Telegram bot — even an AI assistant — in an afternoon: BotFather token, Telegram Trigger, your logic, Telegram reply, public HTTPS. Keep one webhook per bot, watch privacy mode in groups, and graduate to a custom bot when the bot becomes core to your business.

Frequently Asked Questions

Can I build a Telegram bot with n8n?

Yes. n8n has a Telegram Trigger node that starts a workflow when your bot receives a message, and a Telegram node that sends messages, photos and more. You can add AI, databases and hundreds of other apps in between.

Why isn't my n8n Telegram Trigger working?

Telegram needs to reach your n8n instance over public HTTPS. Self-hosted n8n on localhost without a public HTTPS URL won't receive updates. Also, a bot can only have one webhook — if another tool set a webhook for the same bot, n8n's trigger may be overridden.

Can n8n make an AI Telegram bot?

Yes. Connect the Telegram Trigger to n8n's AI agent nodes with a model such as OpenAI or another provider, add memory for conversations, and send the reply with the Telegram node.

n8n or Zapier for a Telegram bot?

Zapier is simpler for basic 'when X happens, send a Telegram message' automations. n8n is more flexible for real bots with branching logic and AI, and can be self-hosted. Both get expensive or complex for high-volume customer-facing bots.

When should I use a custom bot instead of n8n?

When the bot needs a polished button interface, payments, a catalog or dashboard, many users, or precise control over performance and costs.