n8n + Telegram Integration: Build Powerful Bots & Automations
The n8n Telegram integration is one of the most versatile pairings in the automation world. Telegram's Bot API is generous — no per-message fees, no approval processes, and support for rich media, inline keyboards, and group management. Combine that with n8n's visual workflow builder and 400+ integrations, and you can build everything from a simple alert bot to a full conversational AI assistant.
Whether you want to get notified when a server goes down, let your team query a database from a group chat, or build a customer support bot that files tickets automatically, this guide covers it all.
Why Telegram + n8n Is a Powerful Combination
Telegram bots have a few advantages over other messaging platforms for automation:
- Free and unlimited: The Telegram Bot API has no per-message costs and no rate limits for most use cases (up to 30 messages/second to different chats).
- Rich interactions: Bots can send formatted text (Markdown or HTML), photos, documents, locations, and interactive inline keyboards with callback buttons.
- No approval process: Unlike Slack apps or WhatsApp Business, you can create a Telegram bot in seconds and start using it immediately.
- Group and channel support: Bots can operate in group chats and channels, making them useful for team notifications and community management.
n8n has two dedicated Telegram nodes — the Telegram Trigger node (for receiving messages and updates) and the Telegram node (for sending messages and performing actions). Together, they cover the full range of bot interactions.
Setting Up Your Telegram Bot for n8n
Before you build any workflows, you need a Telegram bot token. Here's how to get one:
- Open Telegram and search for @BotFather — this is Telegram's official bot for creating and managing bots.
- Send the command
/newbotand follow the prompts. You'll choose a display name and a username (must end in "bot"). - BotFather will reply with your HTTP API token — a string like
123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11. Copy this. - In n8n, go to Credentials → New Credential → Telegram API and paste your token.
Tip: If you're running n8n on n8nautomation.cloud, your instance already has a public URL with SSL — which is required for Telegram webhooks to work. Self-hosted setups need a reverse proxy with HTTPS configured.
To find your Chat ID (needed for sending messages to a specific chat), add your bot to a chat, send it a message, then use the Telegram Trigger node — the incoming message data will include the chat ID.
The Telegram Trigger Node: Receiving Messages in n8n
The Telegram Trigger node listens for incoming updates from your bot using webhooks. When you activate a workflow with this trigger, n8n automatically registers a webhook with Telegram's API — no manual configuration needed.
You can configure the trigger to listen for specific update types:
- message — text messages, photos, documents, and other content sent to the bot
- edited_message — when a user edits a previously sent message
- callback_query — when a user clicks an inline keyboard button
- channel_post — messages posted to a channel where the bot is an admin
- pre_checkout_query — for Telegram's built-in payments
The trigger outputs the full update object, including the sender's user ID, username, chat ID, message text, and any attached media. You can use n8n's IF node or Switch node downstream to route different message types to different branches of your workflow.
A common pattern is checking {{ $json.message.text }} for specific commands. Telegram bot commands start with / — for example, /status, /help, or /report. You can use a Switch node to match these and respond differently to each command.
Sending Messages, Photos, and Files from n8n
The Telegram node (not the Trigger) handles all outbound actions. The key operations include:
- Send Message: Send text with Markdown or HTML formatting. Supports
parse_modeset to "MarkdownV2" or "HTML" for rich formatting. - Send Photo: Send an image by URL or binary data. Include an optional caption.
- Send Document: Send files of any type — PDFs, CSVs, spreadsheets.
- Send Sticker: Send stickers by file ID.
- Send Chat Action: Show "typing..." or "uploading photo..." indicators while your workflow processes.
- Edit Message Text: Update a previously sent message — useful for updating status messages in place.
- Delete Message: Remove a message from the chat.
- Get Chat Member: Check a user's status in a group (admin, member, etc.).
For the Chat ID field, you can hardcode a specific chat ID for notification workflows, or use {{ $json.message.chat.id }} from a Telegram Trigger to reply to the same chat that sent the message.
., -, (, ), and !. If your messages aren't rendering correctly, switch to HTML parse mode — it's more forgiving and easier to work with in n8n expressions.5 Practical n8n Telegram Workflows You Can Build Today
1. Server Monitoring Alerts
Use a Cron trigger to run every 5 minutes → HTTP Request node to ping your endpoints → IF node to check for non-200 responses → Telegram node to send an alert with the failing URL and status code. Simple, effective, and catches downtime before your users notice.
2. Daily Digest Bot
Schedule a workflow for 8 AM daily → pull data from multiple sources (Google Sheets for KPIs, GitHub for open PRs, a database for pending tasks) → use a Code node to format everything into a clean summary → send it to your team's Telegram group. Replace your morning standup reading with a single message.
3. Form Submission Notifications
Connect a Webhook trigger to your website's contact form → extract the name, email, and message → send a formatted Telegram message to your sales channel with an inline keyboard: "Reply" and "Mark as Spam." When someone clicks a button, a second workflow handles the callback and updates your CRM.
4. AI Chatbot with OpenAI
Telegram Trigger → OpenAI node (or the AI Agent node for multi-step reasoning) → Telegram send message. Feed the user's message to GPT, get a response, and send it back. Add a Memory node to maintain conversation context across messages. You can build a surprisingly capable support bot this way — one that answers FAQs, looks up order status, or troubleshoots common issues.
5. Expense Tracker
Users send a photo of a receipt to the bot → Telegram Trigger captures the image → OpenAI Vision extracts the merchant, amount, and date → Google Sheets node appends a row to your expense spreadsheet. Send a confirmation message back with the parsed details and an inline keyboard to correct any mistakes.
Tip: All five of these workflows run perfectly on a managed n8n instance at n8nautomation.cloud — no need to worry about keeping your server online for webhook triggers or cron schedules.
Advanced Patterns: Inline Keyboards and Callbacks
Inline keyboards turn your Telegram bot from a notification pipe into an interactive application. Here's how they work in n8n:
When sending a message with the Telegram node, you can add Reply Markup of type "Inline Keyboard." Each button has a label and a callback data string. When a user taps a button, Telegram sends a callback_query update to your bot — which your Telegram Trigger node picks up.
The practical pattern looks like this:
- Workflow A sends a message with buttons: "Approve" (callback data:
approve_123) and "Reject" (callback data:reject_123). - Workflow B has a Telegram Trigger listening for
callback_queryupdates. When triggered, it reads{{ $json.callback_query.data }}to determine which button was pressed. - A Switch node routes
approve_*andreject_*to different branches. - Each branch performs the relevant action (update a database, send a notification, etc.) and uses the Answer Callback Query operation to dismiss the loading indicator on the button.
This pattern is incredibly useful for approval workflows — think expense approvals, content review, deployment confirmations, or leave requests. The decision-maker never has to leave Telegram.
You can also edit the original message after a button is clicked to replace the buttons with a status indicator like "✓ Approved by @username" — keeping the chat clean and providing an audit trail.
Production Tips for n8n Telegram Automations
Once your bot is working, here are the things that matter for running it reliably:
- Always answer callback queries. If a user clicks an inline button and you don't call "Answer Callback Query," they'll see a spinning loader for 30 seconds. Even if you have nothing to display, send an empty answer.
- Use the Send Chat Action node. For workflows that take a few seconds to process (like AI responses), send a "typing" action first. It signals to the user that something is happening.
- Handle errors gracefully. Add an Error Trigger workflow that sends you a Telegram message when any workflow fails. This way, your bot never silently breaks.
- Rate limits: Telegram allows about 30 messages per second to different chats, but only 1 message per second to the same chat. If you're sending bulk notifications, add a Wait node with a short delay between messages.
- Restrict access. If your bot handles sensitive data, add an IF node early in the workflow to check the sender's user ID against an allowlist. Reject unauthorized users immediately.
- Store the chat ID in a variable. Don't hardcode chat IDs throughout your workflows. Use n8n's environment variables or a dedicated config workflow to store them in one place.
For uptime, your n8n instance needs to be running 24/7 — Telegram delivers webhook updates in real time, and if your server is down, messages queue for only a limited time. A managed hosting solution like n8nautomation.cloud handles this with automatic backups, guaranteed uptime, and zero server maintenance on your end, starting at $15/month.
Telegram bots built with n8n hit a sweet spot: they're simple enough to build in an afternoon, powerful enough to replace dedicated apps, and flexible enough to connect to your entire tool stack. Start with a simple notification bot, then layer on interactivity as your needs grow.