Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Connect n8n to Telegram

This guide shows you how to make a Telegram bot and link it to n8n, so your workflows can send and receive Telegram messages.

VPS and Cloud Servers2 min read18 steps

What are n8n and a bot?

n8n is a free tool, which you can run on your own server, that links apps together. You build a workflow, which is a chain of steps. Each step is a box called a node. Ask Hostvento support whether n8n is supported on your plan.

A bot is a small helper account run by a program, not by a person. Telegram lets you make one for free using a special chat helper called BotFather.

Part 1: Create the bot

  1. Open Telegram on your phone or computer.
  2. Search for BotFather. Choose the one with the blue tick.
  3. Press Start and send the message /newbot.
  4. Type a display name for your bot.
  5. Type a user name. It must end in bot, for example my_helper_bot.
  6. BotFather sends you a token. This is a long secret code. Copy it and keep it private.

Part 2: Add the token to n8n

  1. In n8n, open Credentials and click Create Credential.
  2. Search for Telegram API.
  3. Paste your token into the Access Token field.
  4. Click Save. n8n should show that the test is successful.

Part 3: Find your chat ID

A chat ID is the number that tells the bot where to send a message.

  1. In Telegram, open your bot and press Start. Send it any message.
  2. In n8n, add a Telegram Trigger node with the update type message, and run it. The incoming data shows chat and an id number. Note it.

Part 4: Send a test message

  1. Create a new workflow and add a Telegram node.
  2. Choose the credential you saved.
  3. Set the operation to Send Message.
  4. Paste your chat ID into Chat ID.
  5. Type some text in Text.
  6. Click Execute step. The message should arrive in Telegram.

Notes

  • A bot cannot start a chat. The person must press Start first.
  • The Telegram Trigger needs n8n to be reachable over a secure https address, since Telegram sends messages to it.
Tip: If your token leaks, message BotFather and use its option to revoke the token, then make a new one.

Quick recap

  • Make a bot with BotFather and copy the token.
  • Save the token as a Telegram credential in n8n.
  • Find your chat ID.
  • Use the Telegram node with Send Message.
  • Use https for triggers.