How to build a Telegram bot in n8n

Create a bot with @BotFather in Telegram, copy its token into a Telegram API credential in n8n, and send your bot a message so it's allowed to write to you. For alerts, use the Telegram node's Send Message with your chat ID. For a bot that replies, start the workflow with a Telegram Trigger, which needs your n8n reachable over public HTTPS.

Buy for $15 AI Automation Starter Pack for n8n — 8 ready-to-import workflows · $15

Step 1: create the bot and credential

  1. In Telegram, open @BotFather and send /newbot. Pick a display name and a username ending in "bot".
  2. BotFather replies with a token like 123456789:AA... Keep it private; anyone with it controls the bot.
  3. In n8n, go to Credentials, add a Telegram API credential and paste the token.
  4. Open your new bot in Telegram and press Start or send any message. Bots can't message people who never wrote to them.

Step 2: find your chat ID

After you have messaged the bot, open the getUpdates address below in a browser (with your token). Find "chat":{"id": ...} in the answer; that number is your chat ID. Group chat IDs are negative numbers. A bot like @userinfobot also tells you your own ID.

https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates

Two kinds of Telegram bot in n8n

A bot can have only one webhook address at a time, so don't point two active workflows at the same bot with Telegram Triggers. Create a second bot for a second chat workflow.

KindStart nodeNeeds public HTTPS?Example
Alert bot (n8n writes to you)Schedule Trigger, Webhook or anythingNoPrice changed, site down, new lead
Chat bot (n8n answers messages)Telegram TriggerYes, Telegram calls your n8nAnswer questions, log notes, run commands

Send Message settings

Telegram node
  Resource: Message
  Operation: Send Message
  Chat ID: {{ $('Config').first().json.telegramChatId }}
  Text: Price change: {{ $json.label }} {{ $json.old_price }} -> {{ $json.new_price }}
  Additional fields: Parse Mode = HTML (only if your text uses tags)

A real alert bot you can import

Workflow 07 in our starter pack is a Telegram alert bot: once a day it checks product pages from a Google Sheet and messages you when a price moves by at least the percentage you set. You put the chat ID in its Config node; the n8n attribution line is switched off. The README also shows how to swap Telegram for Slack.

It was run end to end on n8n 2.49.9 against a local test copy of Telegram, not the real Telegram service, so your first real run is the moment to check the token and chat ID. The pack doesn't include a chat bot that answers messages.

The product

Questions

Why do I get "chat not found"?

Usually the bot has never received a message from that chat, or the chat ID is wrong. Message the bot first, then read the ID from getUpdates again.

Can n8n add an AI chat bot to Telegram?

Yes: Telegram Trigger, then an AI step (an AI node or HTTP Request to your provider), then Telegram Send Message back to the same chat ID.

Does the Telegram Trigger work on localhost?

Not on its own. Telegram must reach your n8n over public HTTPS, so use a hosted n8n or a tunnel.

Related

Updated 2026-12-01