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
- Open Telegram on your phone or computer.
- Search for BotFather. Choose the one with the blue tick.
- Press Start and send the message
/newbot. - Type a display name for your bot.
- Type a user name. It must end in
bot, for examplemy_helper_bot. - BotFather sends you a token. This is a long secret code. Copy it and keep it private.
Part 2: Add the token to n8n
- In n8n, open Credentials and click Create Credential.
- Search for Telegram API.
- Paste your token into the Access Token field.
- 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.
- In Telegram, open your bot and press Start. Send it any message.
- In n8n, add a Telegram Trigger node with the update type message, and run it. The incoming data shows
chatand anidnumber. Note it.
Part 4: Send a test message
- Create a new workflow and add a Telegram node.
- Choose the credential you saved.
- Set the operation to Send Message.
- Paste your chat ID into Chat ID.
- Type some text in Text.
- 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.