How to Connect n8n Automation Workflows to a Telegram Bot
If you're looking for a quick and simple way to connect your n8n automation workflows with a Telegram bot, this article provides clear step-by-step instructions. Whether you're new to automation or seeking a more efficient workflow integration solution, this guide will help you complete the entire configuration in minutes.
On this page
On this page
Anti-detect browser for multi-account operations
- Independent browser profiles
- RPA automation
- Team collaboration
Why Connect n8n to Telegram?
Telegram is more than just an instant messaging tool; its Bot API offers powerful support for automation scenarios. By connecting n8n with Telegram, you can achieve:
- Automatic Message Push: Send automatic notifications to your Telegram when a workflow is triggered.
- Interactive Command Handling: Trigger n8n workflows through Telegram messages.
- Data Collection and Feedback: Utilize Telegram as an entry point for data input.
This integration method is particularly well-suited for scenarios requiring real-time feedback, remote control, or multi-channel notifications.
Preparation: Create a Telegram Bot
Before configuring the connection in n8n, you need to create a bot in Telegram and obtain its Access Token.
Step 1: Find BotFather
In the Telegram search bar, enter BotFather. This is the official bot management tool provided by Telegram. After clicking to start a conversation, you'll see a list of available commands.
Step 2: Create a New Bot
Enter the /newbot command. BotFather will guide you through the following steps:
- Set a Bot Name: For example,
YouTube TG Demo. - Set a Username: It must end with
bot, for example,YouTubeTGDemo_bot.
Once completed, BotFather will return a message containing your API Token (e.g., 123456789:ABCdefGhIjklmNoPQRsTUVwxyZ). This token is the key credential for connecting to n8n, so please keep it safe.
Configure Telegram Connection in n8n
After obtaining your token, proceed with the configuration in n8n.
Step 1: Add a Telegram Trigger
Navigate to your n8n workflow interface and add a Telegram Trigger node. If you haven't created a workflow yet, you can click the "+" button in the top-right corner to create a new one.
Step 2: Create New Credentials
Within the Telegram Trigger node:
- Click the Credential dropdown menu.
- Select Create New Credential.
- In the pop-up window, paste the Access Token you obtained from BotFather.
- Name this credential, for example,
YouTube TG Demo. - Click Save to store the credentials.
Step 3: Test the Connection
After saving your credentials, click the Test Step button. Then, go back to Telegram, find the bot you just created, and send a test message, such as Hello, n8n!.
Within a few seconds, you should see the message content in n8n's output panel, indicating a successful connection.
Important Security Setting: Limit Bot Access
Telegram bots are public by default; anyone can find and use them by their username. To prevent unauthorized use of your workflows, it's recommended to add a simple authentication logic.
Use the IF Node for Authentication
After the Telegram Trigger node, add an IF node:
- Drag the Chat ID field from the Telegram node's output to the IF node.
- Set the condition to Number → Is Equal To.
- Enter your personal Chat ID (you can find this in the output of your first test message).
This ensures that only messages from your own account pass the verification and proceed with the subsequent workflow. Others, even if they find your bot, won't be able to trigger your automation logic.
Common Use Cases
Once successfully connected, you can implement many practical features with n8n + Telegram:
- Server Monitoring Alerts: Automatically send Telegram messages when a server experiences an issue.
- Content Publishing Reminders: Notify your Telegram channel when a new blog post is published.
- Data Scraping and Pushing: Periodically scrape website data and push it to your personal Telegram.
- Remote Command Execution: Trigger server tasks via Telegram messages.
Frequently Asked Questions (FAQ)
What if my Bot Token is compromised?
You can use the /revoke command in BotFather to revoke the old token and generate a new one. Then, update the credentials in n8n with the new token.
How can I make the Bot support multiple users?
You can use the Contains or In Array condition in the IF node to add multiple allowed Chat IDs to a whitelist.
The Telegram Trigger isn't receiving messages, what should I do?
- Check if the Token was pasted correctly.
- Ensure the n8n workflow is activated (status is Active).
- Confirm that the bot you sent the message to is the same one configured in your credentials.
Can I send messages using the Telegram Bot?
Absolutely. In addition to the Trigger node, n8n also offers a Telegram Action node, which allows you to actively send messages, images, files, and other content to specified Chat IDs or channels.
How do I get my Chat ID?
During the first test of the Telegram Trigger, the output data will include message.from.id, which is your Chat ID. You can also quickly obtain it using Telegram's @userinfobot.
Simplify multi-account operations with MasLogin
Bring independent browser profiles, browser identity controls, proxy management, automation and team workflows into one workspace.


