Automate Telegram with n8n: 5 Bot Workflows You Can Build Today
Automating Telegram with n8n opens up a direct, instant communication channel between your workflows and your team — or your customers. Telegram's Bot API is one of the most flexible messaging APIs available, and when you pair it with n8n's visual workflow builder and 400+ integrations, you can build bots that would normally require a backend developer and a hosted server. Here's how to build five real-world Telegram automations, step by step.
Why Telegram + n8n Is a Powerful Combo
Telegram bots are free to create, have no rate-limiting headaches like some messaging platforms, and support rich media — photos, documents, inline keyboards, and formatted text. The problem is that most Telegram bots require you to write and host code to handle webhooks and API calls.
n8n eliminates that entirely. The Telegram node and Telegram Trigger node handle both sending and receiving messages natively. You get:
- Trigger-based listening — the Telegram Trigger node receives messages, commands, and callback queries via webhook in real time
- Rich sending options — send text (with Markdown or HTML formatting), photos, documents, stickers, locations, and even inline keyboards
- Chat management — get chat members, pin messages, set chat descriptions, and moderate groups
- Callback query handling — respond to inline keyboard button presses for interactive bot flows
Because n8n runs persistently on a server (not on-demand like some cloud automation tools), your Telegram webhook listener is always active. That's critical for bots that need to respond instantly. Running your instance on n8nautomation.cloud means your Telegram triggers stay online 24/7 without you managing uptime.
Setting Up the Telegram Node in n8n
Before building any of the workflows below, you need a Telegram bot token. Here's the quick setup:
- Open Telegram and message @BotFather
- Send
/newbot, choose a name and username for your bot - Copy the API token BotFather gives you
- In n8n, go to Credentials → New Credential → Telegram API
- Paste your token and save
For workflows that receive messages, you'll use the Telegram Trigger node. Set the trigger to listen for specific update types: message, callback_query, edited_message, or * for everything. n8n automatically registers a webhook with Telegram when the workflow is activated.
For workflows that send messages, you'll use the Telegram node (action node). You'll need the Chat ID of the recipient — either a user, group, or channel. The easiest way to get this: add your bot to a group, send a message, then use the Telegram API's getUpdates method or simply log incoming trigger data in n8n.
Tip: For channels, use @yourchannel as the Chat ID instead of a numeric ID. For private groups, you'll always need the numeric ID (it starts with -100).
Workflow 1: Server Monitoring Alerts
This workflow pings your server or API endpoint on a schedule and sends a Telegram alert if something is down.
Nodes used:
- Schedule Trigger — runs every 5 minutes
- HTTP Request — sends a GET request to your endpoint (e.g.,
https://api.yourapp.com/health) - IF — checks if the HTTP status code is not 200, or if the response time exceeds a threshold
- Telegram — sends an alert message to your ops channel
In the IF node, set the condition to {{ $json.statusCode }} != 200. On the true branch, connect the Telegram node configured with:
- Operation: Send Message
- Chat ID: your monitoring group's ID
- Text:
🚨 *Alert:* Server health check failed\nStatus: {{ $json.statusCode }}\nTime: {{ $now.toISO() }} - Parse Mode: Markdown
Add a second IF branch to check response time. Use the HTTP Request node's response headers or a Code node to extract timing data. If latency exceeds your threshold (say 2000ms), send a warning-level Telegram message on a separate branch.
Workflow 2: Form Submission Notifications
Get instant Telegram notifications whenever someone fills out a form — whether it's Typeform, Google Forms, Tally, or a custom webhook form.
Nodes used:
- Webhook (or Typeform Trigger / Google Forms Trigger) — receives the submission
- Set — formats the data into a clean message
- Telegram — sends the formatted notification
For the Set node, build a message string that pulls out the fields that matter:
📋 New form submission
Name: {{ $json.fields.name }}
Email: {{ $json.fields.email }}
Message: {{ $json.fields.message }}
Submitted: {{ $now.format('yyyy-MM-dd HH:mm') }}
If you want the team to take action directly from Telegram, use an inline keyboard. In the Telegram node, set Reply Markup → Inline Keyboard and add buttons like "Mark as Contacted" or "View in CRM". Each button sends a callback_query back to a separate workflow where you can update your CRM or database.
Workflow 3: AI-Powered Chatbot Responder
This is where things get interesting. You can build a Telegram bot that uses an LLM to answer questions — a customer support bot, a knowledge base assistant, or even an internal team helper.
Nodes used:
- Telegram Trigger — listens for incoming messages
- IF — filters out non-text messages or bot commands you want to handle separately
- AI Agent (or OpenAI / HTTP Request to any LLM API) — processes the user's message
- Telegram — sends the AI response back
Using n8n's built-in AI Agent node, configure it with:
- A system prompt that defines your bot's personality and knowledge boundaries
- Chat Memory — use the Window Buffer Memory sub-node with the Telegram chat ID as the session key (
{{ $json.message.chat.id }}) so each user gets their own conversation context - Optional tools — connect a Vector Store tool for RAG over your documentation, or an HTTP Request tool so the agent can query your API
In the response Telegram node, set the Chat ID to {{ $('Telegram Trigger').item.json.message.chat.id }} and the text to the AI agent's output. Enable Markdown parse mode since LLMs tend to format with asterisks and backticks.
Workflow 4: Daily Content Digest Bot
Build a bot that aggregates content from multiple sources and sends a formatted daily digest to a Telegram channel or group.
Nodes used:
- Schedule Trigger — fires once daily at 8:00 AM
- RSS Read — pulls latest posts from your favorite blogs or news sources (add multiple RSS nodes for different sources)
- Merge — combines all items into one stream
- Sort — orders by publish date
- Limit — caps at 10 items to keep the digest readable
- Code — formats all items into a single Telegram message with HTML formatting
- Telegram — sends the digest to your channel
In the Code node, build the HTML message:
const items = $input.all();
let message = '📰 <b>Daily Digest</b>\n\n';
items.forEach((item, i) => {
message += `${i + 1}. <a href="${item.json.link}">${item.json.title}</a>\n`;
message += ` <i>${item.json.source}</i>\n\n`;
});
return [{ json: { message } }];
Set the Telegram node's parse mode to HTML for this one, since we're using anchor tags and bold/italic elements. You can extend this by adding an AI Summarize step — pass each article's content through an LLM to generate one-line summaries alongside each link.
Workflow 5: E-Commerce Order Tracker
Let customers check their order status by messaging your Telegram bot with their order number.
Nodes used:
- Telegram Trigger — receives the customer's message
- Code — extracts the order number from the message text using a regex like
/\b(ORD-\d{5,})\b/ - IF — checks if a valid order number was found
- HTTP Request (or MySQL / Postgres node) — queries your order database or API
- Telegram — sends the order status back with an inline keyboard for more actions
On the false branch of the IF node (no order number detected), send a help message: "Please send your order number (e.g., ORD-12345) to check your order status."
On the true branch, after fetching the order data, format the response:
📦 *Order {{ $json.orderNumber }}*
Status: {{ $json.status }}
Items: {{ $json.itemCount }} items
Shipped: {{ $json.shippedDate || 'Not yet shipped' }}
Tracking: {{ $json.trackingUrl || 'Pending' }}
Add inline keyboard buttons like "Track Shipment" (which opens the tracking URL) and "Contact Support" (which triggers a separate workflow to notify your support team with the order context already attached).
Tips for Production Telegram Bots
Once your workflows are built, a few practices keep them reliable:
- Always activate error workflows. Create a dedicated error-handling workflow that sends Telegram error notifications to an admin chat. In each bot workflow's settings, set this as the error workflow. That way you know immediately when a bot stops responding.
- Use the Wait node for multi-step conversations. If your bot needs to collect multiple inputs (like a form wizard), use n8n's Wait node to pause execution until the next message arrives. Set the webhook resume path and match on the chat ID.
- Rate limit your bots. Telegram allows about 30 messages per second to different chats, but only 1 message per second to the same chat. If your workflow might send multiple messages in quick succession to one group, add a Wait node with a 1-second delay between sends.
- Secure your webhook URL. n8n's webhook URLs are unique and hard to guess, but for extra security, validate the
X-Telegram-Bot-Api-Secret-Tokenheader. You can set a secret token in the Telegram Trigger node configuration. - Keep your instance running. Telegram bots depend on active webhook listeners. If your n8n instance goes down, messages queue briefly then get dropped. A managed host like n8nautomation.cloud handles uptime, SSL certificates, and automatic restarts — which matters a lot for always-on bots.
Tip: Test your bot workflows in n8n's manual execution mode first. Send a test message to your bot, then click "Listen for Test Event" on the Telegram Trigger node. Once you see the data structure, building the rest of the workflow is straightforward.
Telegram bots are one of the best use cases for n8n because they demand persistent, always-on webhook listeners paired with complex logic — exactly what n8n does well. Whether you're sending server alerts to your DevOps channel, building an AI assistant for your community, or letting customers track orders in real time, the Telegram node gives you everything you need without writing a single line of bot framework code.