n8nTelegram· 6 min read

Set up the Telegram Trigger node in n8n, step by step


The Telegram Trigger node in n8n authenticates with a single credential, the bot access token BotFather gives you. Telegram allows one webhook per bot, so a test run and a published workflow can’t both receive updates. Unpublish the workflow while you test, or use a second bot for testing. n8n also needs a public HTTPS URL. Behind a reverse proxy, you set it in the WEBHOOK_URL environment variable. Sources are the Telegram Trigger node page and its common issues (accessed 2026-11-04).

Create the bot and the credential

The Telegram credential serves both the Telegram and the Telegram Trigger nodes. Its only authentication method is “API bot access token.”

  1. Start a chat with BotFather and send /newbot.
  2. Give the bot a name. You can change it later.
  3. Pick a username of 5 to 32 Latin letters, digits or underscores, ending in “bot”. It can’t be changed later.
  4. Copy the token BotFather returns.
  5. In n8n, create a Telegram credential and paste the token into Access Token.

Usernames aren’t case-sensitive. The credential page shows no Base URL field. The n8n pages read for this post show no way to point the node at a local Bot API server.

Pick the updates

The trigger’s list of updates follows Telegram’s update types. * means every update except Chat Member, Message Reaction and Message Reaction Count. That matches Telegram’s own default for allowed_updates. The entries most bots start with are below, with the field each one corresponds to in a Telegram Update.

n8n update Telegram Update field Fires when
Message message A new message arrives in a chat the bot can read
Edited Message edited_message A message the bot already received is edited
Channel Post channel_post A new post appears in a channel the bot belongs to
Callback Query callback_query A user taps a button on an inline keyboard
My Chat Member my_chat_member The bot is added, removed or changes status in a chat

The full list also covers business messages, inline queries, polls, chat boosts, join requests and payment events. n8n notes that some events need extra permissions. On Telegram’s side, chat_member and message_reaction arrive only if the bot is an administrator and asks for them explicitly. n8n’s pages don’t say whether the node sends your selection to Telegram as allowed_updates.

In groups, Telegram decides what the trigger sees before n8n does. A bot in privacy mode gets commands and replies, not ordinary chatter. The fix is in why your Telegram bot doesn’t see group messages.

Set the options

The trigger has three options, and the first has an Image Size sub-option. Download Images/Files adds attached images or files to the output, and Image Size picks the size to download, with Large as the default. Restrict to Chat IDs and Restrict to User IDs take comma-separated IDs, and the trigger fires only for those.

n8n doesn’t document the trigger’s output JSON or the binary property name the download uses. Run a test execution and read both from the output before you map fields.

One bot, one webhook

n8n’s common issues page says “Telegram only allows you to register a single webhook per app.” The result is a workflow that only works in testing or in production. n8n offers two ways out. “You can either disable your workflow when testing,” or “create separate Telegram bots for testing and production.”

For the first route, click Unpublish, run your test, then click Publish again. n8n warns that this “temporarily disables your production workflow for testing.” For a bot with live users, a second bot with its own credential costs nothing in downtime. n8n webhook not receiving events covers the same test and production mix-up on the Webhook node.

The single webhook also blocks other tools on the same bot. Telegram’s reference says “You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.” A polling script and n8n can’t share one bot. Any other tool that calls setWebhook on the bot takes its updates away from n8n.

See which URL holds the webhook

getWebhookInfo returns the registered url, pending_update_count, last_error_date, last_error_message, max_connections and allowed_updates (getWebhookInfo, accessed 2026-11-04). Telegram and n8n publish no sample for this check. The script below was written for this post and uses only the Python standard library.

# check_webhook.py  usage: TELEGRAM_BOT_TOKEN=BOT_TOKEN python check_webhook.py
import json
import os
import sys
import urllib.error
import urllib.request
from datetime import datetime, timezone

BASE = os.environ.get("TELEGRAM_API_BASE", "https://api.telegram.org")
TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN") or sys.exit("set TELEGRAM_BOT_TOKEN")
URL = BASE + "/bot" + TOKEN + "/getWebhookInfo"


def fetch():
    try:
        with urllib.request.urlopen(URL, timeout=30) as r:
            return json.load(r)
    except urllib.error.HTTPError as e:
        try:
            return json.load(e)  # Telegram puts the error in a JSON body
        except ValueError:
            return {"ok": False, "error_code": e.code, "description": str(e.reason)}


def main():
    data = fetch()
    if not data.get("ok"):
        sys.exit(f"getWebhookInfo failed: {data.get('error_code')} {data.get('description')}")
    info = data["result"]
    print("url:", info.get("url") or "(empty)")
    print("pending_update_count:", info.get("pending_update_count"))
    print("allowed_updates:", info.get("allowed_updates", "(not returned)"))
    print("max_connections:", info.get("max_connections", "(not returned)"))
    if info.get("last_error_date"):
        when = datetime.fromtimestamp(info["last_error_date"], timezone.utc)
        print("last_error:", when.isoformat(), info.get("last_error_message"))


if __name__ == "__main__":
    main()

If url points at a host other than your n8n instance, another tool registered the bot last. The n8n pages read for this post don’t publish the test and production URL paths. If url is on your instance and the published workflow still gets nothing, check whether a test run came after the last publish. A rising pending_update_count next to a last_error_message shows Telegram failing to deliver to that URL.

Fix “An HTTPS URL must be provided for webhook”

The full error n8n lists is “Bad request: bad webhook: An HTTPS URL must be provided for webhook”. It appears when n8n runs behind a reverse proxy without the right public URL. n8n’s fix is that “you must configure the WEBHOOK_URL environment variable with the public URL where your n8n instance is running.” Use the HTTPS address, such as https://N8N_DOMAIN, with TLS terminated at the proxy.

Telegram adds its own conditions in the bot FAQ (accessed 2026-11-04). “You need a valid SSL certificate for webhooks to work.” “Redirects are not supported.” The certificate’s “CN must exactly match your domain,” and “Wildcard certificates may not be supported.” Webhooks work only on ports 443, 80, 88 and 8443 (setWebhook).

Fix a test run stuck waiting for an event

A test with Execute step or Execute workflow can hang while it waits for the trigger event. n8n says the usual cause is a reverse proxy that doesn’t pass websockets. Check the Nginx, Caddy, Apache or Traefik configuration and enable websocket support. Per n8n, these hangs “often occur due to issues with your network configuration outside of n8n.”

Reply with the Telegram node

The Telegram node sends replies with message operations such as Send Message, Send Photo, Send Document and Send Chat Action. Send Message needs two fields (message operations, accessed 2026-11-04).

Field What to put in it
Chat ID The chat to answer, mapped from the trigger’s message.chat.id
Text Up to 4096 characters after entities parsing

message.chat.id is Telegram’s field path. n8n doesn’t document the expression, so confirm it against a test execution. Under Additional Fields, Parse Mode defaults to HTML. Reply To Message ID threads the answer, and Message Thread ID targets a forum topic. Append n8n Attribution is on by default and adds “This message was sent automatically with n8n”. Turn it off to drop that line.

To send a file the trigger downloaded, turn on Binary File in Send Photo and set the Input Binary Field.

Errors the Telegram node lists

n8n’s Telegram node common issues page covers channels, chat IDs and sending speed. Forbidden: bot is not a participant of the channel means you must add the bot to the channel first. A @channelusername Chat ID works only on public channels, and group Chat IDs need a - prefix. n8n also states Telegram’s limit as 30 messages per second. It suggests a Code node that waits a few seconds between batches. Telegram’s side of that limit is in Telegram Bot API limits: 429 errors and retry_after.

The same trigger pattern for WhatsApp is in set up the WhatsApp Trigger node in n8n. If you serve the bot outside n8n, Telegram webhooks with secret_token covers setWebhook and its header check.

Z-API Omni team