Contents
- The Short Answer
- The 4 Causes at a Glance
- Cause 1: n8n Runs Locally With No Public HTTPS Address
- Cause 2: Behind a Reverse Proxy, n8n Does Not Know Its Public URL
- Cause 3: The Variable Is Set, but to the Wrong Value
- Cause 4: You Rely on n8n's Built-In --tunnel
- Check What Telegram Actually Registered
- Still Broken? Check These in Order
- How to Stop It Coming Back
- Sources
- FAQ
The Short Answer
The Telegram Trigger node fails when you listen for a test event or publish the workflow, with:
Telegram Trigger: Bad Request: bad webhook: An HTTPS URL must be provided for webhook
The text after "Bad Request:" comes from Telegram, not n8n. The Telegram Trigger receives messages by webhook: n8n calls Telegram's setWebhook method and hands over its own webhook URL. The Telegram Bot API requires that URL to be HTTPS, so anything starting with http:// is refused.
The n8n Telegram Trigger common issues page gives the fix in two lines: Telegram requires HTTPS, so terminate TLS at your reverse proxy and set the webhook URL variable to your public HTTPS address. What it leaves out is how to do that on a laptop, in Docker, and how to check what Telegram actually received. That is what this page covers.
n8n Cloud already has a public HTTPS URL. This is a self-hosted problem.
The 4 Causes at a Glance
| Symptom | Cause | Fix | How to confirm |
|---|---|---|---|
| Fails on a laptop or local Docker | No public HTTPS address exists | Run a tunnel, set the webhook URL variable to it | The Telegram Trigger's webhook URL starts with http://localhost:5678 |
| Fails on a server with a working HTTPS domain | Reverse proxy terminates TLS but n8n was not told its public URL | Set N8N_WEBHOOK_URL or WEBHOOK_URL and N8N_PROXY_HOPS, restart | The editor opens on https:// but the node's webhook URL shows http:// or port 5678 |
| Variable is set and it still fails | The value is wrong, or the container was not recreated | Use https://, no :5678, recreate the container | Print the variable inside the running container |
| Started with n8n start --tunnel | The built-in tunnel was removed in n8n 2 and discontinued for v1 | Use ngrok or Cloudflare Tunnel | Your start command contains --tunnel |
Cause 1: n8n Runs Locally With No Public HTTPS Address
This is the main forum thread (almost 20,000 views): n8n in Docker Desktop on Windows, port 5678, and the error. The n8n team's reply: Telegram requires your n8n server to be publicly reachable over HTTPS, and a local Docker instance does not meet that. Telegram's servers cannot reach localhost on your machine, with or without HTTPS.
How to confirm it: open the Telegram Trigger node and look at its webhook URL. If it starts with http://localhost:5678/, n8n is offering Telegram an address it cannot use.
The fix: put a tunnel in front of n8n, then tell n8n the tunnel's address. With ngrok:
ngrok http 5678
Or a Cloudflare quick tunnel:
cloudflared tunnel --url http://localhost:5678
Each prints a public https:// address. The thread asks how to pass it to the standard docker run command and never gets an answer. Add the variables with -e:
docker run -it --rm --name n8n -p 5678:5678 \
-e N8N_WEBHOOK_URL=https://your-subdomain.ngrok-free.app/ \
-e N8N_PROXY_HOPS=1 \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
On n8n older than 2.30.0, use WEBHOOK_URL instead of N8N_WEBHOOK_URL (see the version note in Cause 2). Then open the workflow and listen for a test event, or publish it, so the trigger registers the new URL with Telegram.
Free tunnel addresses usually change each time the tunnel restarts. When it changes, update the variable, restart n8n and re-register. Our Telegram AI agent tutorial says the same. For anything that must stay up, use a real domain.
Cause 2: Behind a Reverse Proxy, n8n Does Not Know Its Public URL
You have a domain, a certificate and a proxy (Nginx, Caddy, Traefik), and the editor loads fine over HTTPS. The trigger still fails. This is the case the n8n docs describe.
The reason, from the reverse proxy docs: n8n builds webhook URLs from N8N_PROTOCOL, N8N_HOST and N8N_PORT. Behind a proxy, n8n runs on plain http on port 5678 while the proxy serves 443, so the URL n8n builds, and sends to Telegram, is the internal one.
How to confirm it: the browser shows https://n8n.example.com, but the Telegram Trigger's webhook URL shows http://, an internal host, or :5678.
The fix: set the public URL explicitly. In Docker Compose:
services:
n8n:
image: docker.n8n.io/n8nio/n8n
environment:
- N8N_WEBHOOK_URL=https://n8n.example.com/
- N8N_PROXY_HOPS=1
The proxy must pass X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto to n8n.
Which variable name. The n8n docs say N8N_WEBHOOK_URL is available from n8n 2.30.0 and replaces WEBHOOK_URL, which is deprecated from 2.35.0 and logs a deprecation warning. On older versions, including every n8n 1.x release, use WEBHOOK_URL. The Telegram common issues page and most forum answers still say WEBHOOK_URL. That is right for older versions and not wrong yet on newer ones, but it is the deprecated name. Check your version on the About n8n page, under Help in the editor's bottom-left menu, and pick accordingly.
Cause 3: The Variable Is Set, but to the Wrong Value
In the second big thread the user set:
WEBHOOK_URL=http://<local_ip_address>:5678/
That cannot work. It is http, and a local IP is not reachable from Telegram. The common slips:
- http instead of https. The value must start with
https://. - Port 5678 left in the URL. Telegram's API lists the supported webhook ports as 443, 80, 88 and 8443. An HTTPS URL ending in
:5678gets a different error,Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443. Point the variable at the proxy or tunnel address, which uses 443, not at n8n's own port. - The container was not recreated. n8n reads environment variables at startup. Editing
docker-compose.ymldoes nothing until you rundocker compose up -d, which recreates the container when its configuration changes. - A self-signed certificate. Telegram accepts one only if the certificate is uploaded with
setWebhook. The n8n Telegram Trigger docs describe no option for that, so use a publicly trusted certificate, such as one your proxy gets from Let's Encrypt.
How to confirm it: check what the running container actually has:
docker exec n8n printenv | grep WEBHOOK_URLCause 4: You Rely on n8n's Built-In --tunnel
Older guides, and the 2023 thread, fix this with n8n start --tunnel, which gave a local instance a temporary public URL. That advice is out of date. In March 2026 n8n announced the tunnel service is discontinued: the option was already removed in n8n 2, and starting a v1 instance with --tunnel now times out with an error. n8n recommends a third-party provider such as Cloudflare Tunnel or ngrok instead.
The 2023 thread also found that n8n 1.1.1 set tunnel URLs incorrectly, fixed in a later release. If you are on a very old 1.x version, upgrade first.
The fix: follow Cause 1 with ngrok or Cloudflare Tunnel.
Check What Telegram Actually Registered
Telegram will tell you the URL it holds for your bot and the last delivery error. Replace the token with your bot token:
curl "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getWebhookInfo"
The fields that matter, from the Bot API reference:
url: the registered webhook. Empty means none is set. After the fix it should be your HTTPS address with/webhook/(published) or/webhook-test/(testing) in the path.last_error_message: the most recent delivery failure. If registration worked but messages still do not arrive, this says why.pending_update_count: updates waiting to be delivered.
Two related behaviours, both from n8n's common issues page. Telegram allows only one webhook per bot, so testing and publishing overwrite each other's registration: a workflow that works in test stops working in production, or the reverse. Use a separate bot for testing, or unpublish while you test. And if the trigger hangs on "waiting for trigger event" behind a proxy, enable websocket proxying.
If the HTTPS error is gone but messages get a 404, see The requested webhook is not registered. If n8n cannot reach the Telegram API at all, see connect ECONNREFUSED.
Still Broken? Check These in Order
- The webhook URL shown in the Telegram Trigger starts with
https://and has no:5678. printenvinside the container shows the variable name that matches your n8n version.- Opening
https://your-domain/healthzfrom a phone on mobile data returns a response, so the address is public. - The certificate is publicly trusted, not self-signed.
- You re-ran the test or republished after restarting, so
setWebhookwas called again. getWebhookInfoshows your HTTPS URL and nolast_error_message.- No other workflow or bot framework uses the same bot token, since only one webhook per bot is allowed.
How to Stop It Coming Back
Set the webhook URL variable in your compose file on day one, before the first trigger. Every webhook-based trigger depends on it, not just Telegram.
Use a stable address. A domain with a proxy, or a named tunnel with a fixed hostname. Free tunnel addresses that change on restart bring this error back every time.
Keep one bot for testing and one for production. It removes the test-versus-production webhook fight entirely.
Re-check after upgrades. If you move past n8n 2.35.0, rename WEBHOOK_URL to N8N_WEBHOOK_URL so the deprecation does not become a breakage later.
Running n8n yourself means owning details like these. Our guide to the true cost of self-hosting n8n covers what you take on, and the self-hosting glossary entry covers the trade-off. Webhooks versus polling is explained in polling vs webhook, and the n8n review covers the platform. The n8n AI Agents course builds chat agents on webhook triggers end to end, then covers memory per user, tools, error handling, and choosing between self-hosted and n8n Cloud when you deploy.
Sources
Checked against n8n's documentation, Telegram's Bot API and the n8n community forum on 17 November 2026.
- n8n docs: Telegram Trigger common issues - this error, one webhook per bot, websocket proxying.
- n8n docs: Configure webhook URLs with reverse proxy - N8N_WEBHOOK_URL from 2.30.0, WEBHOOK_URL deprecated from 2.35.0, N8N_PROXY_HOPS, forwarded headers.
- Telegram Bot API: setWebhook and getWebhookInfo - HTTPS requirement, ports 443, 80, 88, 8443, self-signed certificates, WebhookInfo fields.
- n8n blog: tunnel service discontinued - --tunnel removed in n8n 2.
- n8n community: thread 110136 - local Docker case.
- n8n community: thread 29719 - http WEBHOOK_URL, the 1.1.1 tunnel bug.
- n8n community: thread 188485 - the ports variant.
FAQ
- What does "An HTTPS URL must be provided for webhook" mean in n8n?
- The Telegram Trigger tried to register n8n's webhook URL with Telegram, and Telegram rejected it because it is not HTTPS. n8n built an http or localhost URL from its own settings. Give n8n a public HTTPS address and set the webhook URL variable to it.
- Can I use the Telegram Trigger on localhost?
- Not directly. Telegram must reach your instance over public HTTPS. Run a tunnel such as ngrok or Cloudflare Tunnel, set N8N_WEBHOOK_URL (or WEBHOOK_URL before n8n 2.30.0) to the tunnel's https address, restart n8n and re-register the trigger.
- Should I use WEBHOOK_URL or N8N_WEBHOOK_URL?
- The n8n docs say N8N_WEBHOOK_URL is available from 2.30.0 and replaces WEBHOOK_URL, which is deprecated from 2.35.0. On earlier versions, including all of n8n 1.x, use WEBHOOK_URL. Check your version on the About n8n page, under Help in the editor's bottom-left menu.
- Does n8n start --tunnel still work?
- No. n8n has discontinued its tunnel service. The option was removed in n8n 2, and starting a v1 instance with --tunnel now times out with an error. n8n recommends Cloudflare Tunnel or ngrok instead.
- Why do I now get "Webhook can be set up only on ports 80, 88, 443 or 8443"?
- Your URL is HTTPS now, but includes a port Telegram does not accept, usually :5678. Telegram's API supports webhooks on ports 443, 80, 88 and 8443 only. Point the webhook URL variable at your proxy or tunnel address, which uses 443.
- Why does my Telegram workflow work in test but not when published?
- Telegram allows one webhook per bot, so the test URL and production URL overwrite each other. n8n's docs suggest a separate bot for testing, or unpublishing the workflow while you test and republishing after.
- How do I see which webhook URL Telegram has for my bot?
- Call https://api.telegram.org/bot<token>/getWebhookInfo. The url field shows the registered webhook and last_error_message shows the most recent delivery failure.
If this resonated
Module 02 is the long version of this post.
Eval set, refusal pattern, kill switch. Build it in a weekend.
