How to integrate Telegram with n8n
Integrating Telegram with n8n allows you to build powerful automation workflows that connect your Telegram channels, groups, and bots with hundreds of other services — all without writing code. n8n is a self-hostable, open-source workflow automation tool that offers a dedicated Telegram node, making it one of the most flexible options for Telegram automation.
What Is n8n and Why Use It with Telegram
n8n (pronounced "nodemation") is a workflow automation platform similar to Zapier or Make, but with a key difference: you can self-host it, giving you full control over your data and no per-task pricing limits. For Telegram channel owners and community managers, this means unlimited automations at a fixed cost.
Common use cases for Telegram + n8n integration include:
- Auto-posting content from RSS feeds, blogs, or social media to your Telegram channel
- Forwarding messages between Telegram and Slack, Discord, or email
- Monitoring keywords in groups and triggering alerts
- Collecting form responses and sending them to Telegram
- Scheduling messages with dynamic content from external APIs
- Building interactive bots that query databases or third-party services
- Syncing subscriber data with CRMs like HubSpot or Notion databases
Prerequisites
Before you start, make sure you have:
- A running n8n instance — either self-hosted (Docker, npm) or n8n Cloud
- A Telegram bot — created via @BotFather
- The bot token — the API key BotFather gives you after creating the bot
- Admin rights — if you want the bot to post in a channel, it must be added as an administrator
Step-by-Step Integration Guide
Step 1: Create a Telegram Bot
- Open Telegram and search for
@BotFather - Send the command
/newbot - Choose a display name (e.g., "My Automation Bot")
- Choose a username ending in
bot(e.g.,my_automation_n8n_bot) - Copy the HTTP API token — it looks like
7123456789:AAH1bGciOiJSUzI1NiIsInR5c
Keep your bot token secret. Anyone with this token can control your bot. If it leaks, use
/revokentokenin BotFather immediately.
Step 2: Add the Bot to Your Channel
- Open your Telegram channel settings
- Go to Administrators → Add Administrator
- Search for your bot by its username
- Grant it the permission Post Messages (and optionally Edit Messages and Delete Messages)
- Save the changes
Step 3: Set Up Telegram Credentials in n8n
- Open your n8n instance and go to Settings → Credentials
- Click Add Credential → search for Telegram
- Select
Telegram API - Paste your bot token into the
Access Tokenfield - Click Save — n8n will verify the connection automatically
Step 4: Create Your First Workflow
Example: Auto-Post RSS Feed to Telegram Channel
- Click New Workflow in n8n
- Add an RSS Feed Read node:
- Set the RSS URL (e.g.,
https://yoursite.com/feed.xml)
- Set the RSS URL (e.g.,
-
Add a Telegram node after it:
- Operation:
Send Message - Chat ID: your channel ID (e.g.,
@mychannelor the numeric ID like-1001234567890) - Text: Use expressions to format the message: ``` 📰 {{ $json.title }}
{{ $json.contentSnippet }}
🔗 [Read more]({{ $json.link }})
``Markdown`
- Parse Mode: - Operation:
-
Add a Schedule Trigger at the start:
- Set it to run every 30 minutes or at your preferred interval
Activate the workflow
Finding Your Channel's Chat ID
The chat ID is essential for sending messages. There are several ways to find it:
-
For public channels: use
@channelnameformat directly -
For private channels: forward a message from the channel to
@userinfobotor@getidsbot -
Via n8n: use the Telegram Trigger node, send a message to the bot, and inspect the
chat.idfield in the output
Step 5: Using the Telegram Trigger Node
The Telegram Trigger node lets n8n react to incoming Telegram events in real time. This is essential for building interactive bots.
- Add a Telegram Trigger node to a new workflow
- Select the updates you want to receive:
-
message— new messages -
callback_query— inline button clicks -
channel_post— new posts in channels where the bot is admin -
edited_message— message edits
-
- Activate the workflow — n8n will automatically register a webhook with Telegram
From here, you can branch your workflow logic using If nodes, Switch nodes, or Code nodes to handle different commands or message types.
Advanced Integration Patterns
Pattern 1: Cross-Platform Content Syndication
Set up a workflow that monitors your Telegram channel for new posts and automatically:
- Publishes a summary to Twitter/X
- Creates a blog post draft in WordPress
- Archives the content on a platform like tgchannel.space for web visibility
- Sends a notification to your team's Slack channel
Pattern 2: Moderation Bot
Build an automated moderation system:
1. Telegram Trigger catches every new message in a group
2. Code node checks message text against a banned-words list or calls an AI moderation API
3. If node branches based on the result
4. Telegram node deletes offending messages and warns the user
5. Google Sheets node logs moderation actions for review
Pattern 3: Scheduled Digest Messages
- Schedule Trigger fires daily at 9:00 AM
- HTTP Request node fetches data (weather, stock prices, news headlines)
- Code node formats the data into a clean Telegram message
- Telegram node posts the digest to your channel
Pattern 4: Subscriber Welcome Flow
-
Telegram Trigger detects
new_chat_membersevent - Wait node pauses for 30 seconds
- Telegram node sends a personalized welcome message with inline buttons
- Telegram Trigger catches the button callback
- Branch logic assigns roles or sends relevant resources
Tips & Best Practices
-
Use
MarkdownorHTMLparse mode for formatted messages. Telegram supports bold, italic, links, and code blocks — use them to make automated posts look polished, not robotic. - Add error handling nodes to every workflow. Telegram's API has rate limits (around 30 messages per second to different chats, 1 message per second to the same chat). Use the Error Trigger node and a retry mechanism to handle failures gracefully.
- Store your bot token in n8n credentials, not in workflow nodes. This makes it easy to rotate tokens and keeps sensitive data centralized.
-
Use the
Waitnode between multiple Telegram sends to avoid hitting rate limits. A 1-second delay between messages is usually sufficient. - Test with a private group first. Before activating a workflow for your main channel with 50,000 subscribers, test it in a small private group to catch formatting issues and logic errors.
- Pin n8n to a specific version if self-hosting. Major updates occasionally change node behavior, and you don't want a production workflow to break unexpectedly.
- Leverage n8n's built-in expression editor to dynamically insert dates, subscriber counts, or conditional text into your Telegram messages.
Common Mistakes
Mistake 1: Using the wrong Chat ID format
Why it's wrong: Numeric IDs for groups and channels are negative numbers (e.g., -1001234567890). Using a positive number or forgetting the -100 prefix will cause a "chat not found" error.
How to avoid: Always verify the Chat ID by using @getidsbot or inspecting the Telegram Trigger output.
Mistake 2: Not granting the bot admin rights in channels
Why it's wrong: Bots cannot post to channels unless they are administrators with the Post Messages permission. You'll get a 403 Forbidden error.
How to avoid: Double-check the bot's role in your channel settings before activating the workflow.
Mistake 3: Sending too many messages too fast
Why it's wrong: Telegram enforces rate limits. Exceeding them results in 429 Too Many Requests errors and can temporarily block your bot.
How to avoid: Add Wait nodes (1–3 seconds) between sends, and use the Split In Batches node for bulk operations.
Mistake 4: Hardcoding channel IDs across multiple workflows
Why it's wrong: If you change channels or need to update the target, you'll have to edit every single workflow manually.
How to avoid: Use n8n Variables (available in newer versions) or a Set node at the start of each workflow to define the channel ID once.
Mistake 5: Ignoring webhook conflicts
Why it's wrong: Telegram allows only one webhook per bot. If you use the same bot token in n8n and another service (or another n8n instance), they'll overwrite each other's webhooks.
How to avoid: Use a dedicated bot for n8n automations. Create separate bots for separate tools.
Frequently Asked Questions
Can I use n8n with Telegram without self-hosting?
Yes. n8n offers a cloud-hosted version at n8n.io with a free tier that includes 220 workflow executions. For heavy Telegram automation, the self-hosted option gives you unlimited executions.
Can n8n send photos and files to Telegram?
Absolutely. The Telegram node supports Send Photo, Send Document, Send Video, and Send Audio operations. You can pass binary data from previous nodes (like an HTTP Request that downloads an image) directly into the Telegram node.
Does n8n support Telegram inline keyboards and buttons?
Yes. When sending a message, you can define Reply Markup with inline keyboard buttons. Combine this with the Telegram Trigger node listening for callback_query to build interactive bot experiences.
How do I handle multiple Telegram bots in n8n?
Create separate Telegram credentials for each bot. When adding a Telegram node to your workflow, select the appropriate credential from the dropdown. There's no limit on how many bot credentials you can store.
Can n8n read messages from a Telegram channel I don't own?
Only if your bot is a member of that channel or group. For public channels, you can use the Telegram API's getChat and getChatHistory methods via the HTTP Request node, but this requires a user account API (MTProto), which is more complex than the Bot API that n8n uses natively.