n8n Telegram Trigger Not Working: HTTPS Webhook Fixes
Telegram gives each bot exactly one HTTPS webhook. Nearly every dead Telegram Trigger comes down to that URL being wrong, insecure or overwritten, and one API call tells you which.
Saksham Dogra 8 min read
If your n8n Telegram Trigger is not working, Telegram almost certainly has the wrong webhook URL for your bot: an http:// or localhost address it refuses, a test URL that overwrote production, or a URL set by hand that n8n rejects. Run getWebhookInfo (below), read the url and last_error_message fields, and apply the matching fix.
Why it bites founders: Telegram allows one webhook per bot, and only over HTTPS on ports 443, 80, 88 or 8443. A support bot or lead-capture bot can look healthy on the canvas while every customer message in production goes nowhere.
Free downloads
- Telegram webhook health-check workflow (JSON): import into n8n, paste your bot token and public URL, run it. It calls
getWebhookInfoand tells you in plain English whether you’re on the test URL, on http, on a bad port, or getting 403/404/TLS errors. It also has an optionaldeleteWebhooknode for a clean reset. - docker-compose.yml: n8n behind Caddy with HTTPS: n8n plus Caddy with automatic certificates,
N8N_WEBHOOK_URL/WEBHOOK_URLandN8N_PROXY_HOPSalready set. Placeholders only; swap in your domain.
Checked on 4 Nov 2026 against docs.n8n.io, the Telegram Bot API docs and the Telegram Trigger source on GitHub. We haven’t run these on our own instance; behavior described is per docs and source. n8n now says “publish” where older threads say “activate”.
Step 1: ask Telegram what it has
Replace <TOKEN> with your bot token (keep the word bot in front of it):
curl -s https://api.telegram.org/bot<TOKEN>/getWebhookInfo
Telegram’s docs list the fields that matter: url (empty if no webhook is set), pending_update_count, last_error_date, last_error_message, ip_address and allowed_updates. A healthy n8n production registration looks like https://YOUR-DOMAIN/webhook/<id>/webhook, because the Telegram Trigger’s webhook path is webhook (per the node source).
Symptom → cause → fix
| What you see | Likely cause | Fix |
|---|---|---|
Publish fails: Bad Request: bad webhook: An HTTPS URL must be provided for webhook |
n8n is advertising http:// or localhost:5678 |
Fix 1 |
url contains /webhook-test/ and the published workflow never runs |
Testing overwrote the production webhook | Fix 3 |
url is empty |
Workflow unpublished, activation failed, or something called deleteWebhook |
Fix 3, Fix 4 |
url is an old domain or another instance |
A second n8n instance, script or old setup re-registered the bot | Fix 4 |
last_error_message: 403 Forbidden |
Webhook set by hand; n8n rejects it without its secret token | Fix 5 |
last_error_message: 404 Not Found |
Telegram points at a path nothing listens on (often a stale test URL) | Fix 3, Fix 5 |
last_error_message mentions SSL, certificate or timeout; pending_update_count climbing |
Telegram can’t reach your server or doesn’t trust the certificate | Fix 2 |
| “Listen for test event” spins forever and won’t stop | Reverse proxy isn’t passing WebSockets | Fix 2 |
| Only one of two Telegram workflows fires | Two triggers on one bot; the last one activated wins | Fix 4 |
Fix 1: give n8n a public HTTPS URL
When the Telegram Trigger activates, n8n calls Telegram’s setWebhook with its own webhook URL. Telegram only accepts HTTPS, so if n8n thinks it lives at http://localhost:5678, you get the “An HTTPS URL must be provided” error. n8n’s docs explain why: it builds webhook URLs from N8N_PROTOCOL, N8N_HOST and N8N_PORT, which is wrong behind a reverse proxy that exposes port 443 while n8n listens on 5678.
The fix, per n8n’s reverse-proxy page:
export N8N_WEBHOOK_URL=https://n8n.example.com/
export N8N_PROXY_HOPS=1
- On the last proxy, pass
X-Forwarded-For,X-Forwarded-HostandX-Forwarded-Proto. - Which name? n8n’s endpoints reference says
WEBHOOK_URLis deprecated from n8n 2.35.0 and is now an alias ofN8N_WEBHOOK_URL. It still works but logs a warning. Older versions only readWEBHOOK_URL. Our compose file sets both to the same value, which covers either case. The Telegram common-issues page still saysWEBHOOK_URL. - Restart n8n, then unpublish and publish the Telegram workflow so it registers the new URL.
Running on your laptop? Telegram can’t reach localhost. In GitHub issue #13682 an n8n team member closed the “bug” and pointed to a tunnel such as ngrok or Cloudflare, or a reverse proxy with WEBHOOK_URL set to your domain. Skip n8n’s own --tunnel flag for this: in a community thread n8n staff call it testing-only and say it swaps your webhook URL for a randomly generated one.
On n8n Cloud? HTTPS is handled for you, so skip to Fix 3.
Fix 2: meet Telegram’s network rules
Telegram’s webhook guide lists what your server must do:
| Requirement (per Telegram) | What it means for n8n |
|---|---|
| HTTPS only, TLS 1.2 or newer | Terminate TLS at Caddy, Traefik or nginx in front of n8n |
| Ports 443, 80, 88 or 8443 only | Don’t put :5678 in N8N_WEBHOOK_URL; serve on 443 |
| IPv4 (IPv6 not supported for webhooks) | Give your domain an A record, not just AAAA |
| Certificate CN or SAN matches the domain, full intermediate chain | A browser may accept a broken chain; Telegram won’t |
Accept POSTs from 149.154.160.0/20 and 91.108.4.0/22 |
Only matters if you firewall by IP; Telegram says the range may change |
If last_error_message mentions a certificate or a timeout, test from outside your network, as Telegram’s guide suggests: openssl s_client -tls1_2 -connect n8n.example.com:443 -servername n8n.example.com.
The stuck “Listen for test event” problem is different. n8n’s docs say it usually means your reverse proxy isn’t configured for WebSocket proxying, so check that setting in nginx, Caddy, Apache or Traefik. Caddy’s reverse_proxy handles WebSocket upgrades and sets the three X-Forwarded-* headers by default, which is why our compose file uses it. If the canvas stays stuck, n8n’s docs say to exit the workflow and open it again.
Fix 3: stop test and production fighting over one webhook
This is the most common “it worked yesterday” cause. n8n’s docs: “Telegram only allows you to register a single webhook per app.” Each time you switch between the test URL and the production URL, Telegram overwrites the registered one. The node even shows a notice: one Telegram trigger per bot at a time.
So the sequence that breaks production is:
- Workflow is published; Telegram points at
/webhook/.... - You click Execute workflow to debug. n8n registers
/webhook-test/.... - You stop testing. Telegram is left pointing at the test URL, which no longer listens (or at nothing, if the test listener removed it). Production is silent.
n8n’s docs give two workarounds:
- Unpublish while testing, publish when done. Publishing registers the production URL again. The catch: production traffic stops while the workflow is unpublished.
- Use a separate bot for testing. A community answer spells out the routine: create the second bot, save it as its own Telegram credential, build against it, and switch back to the live bot’s credential before you publish. This is the cleaner option once real users depend on the bot.
Then confirm with getWebhookInfo that url contains /webhook/, not /webhook-test/. Production runs don’t appear on the canvas, so check the workflow’s Executions tab.
Fix 4: one bot, one consumer
Telegram’s two ways of receiving updates, getUpdates polling and webhooks, are mutually exclusive, and a bot has one webhook. Anything else holding your token can steal it:
- A second Telegram Trigger in another workflow using the same bot. Each activation re-registers the bot’s one webhook, so the last one wins.
- A second n8n instance: an old trial, a local Docker copy, a staging server.
- A script or library using the same token. A community answer notes that some polling libraries call
deleteWebhookon their own whengetUpdatesis refused, which silently wipes n8n’s registration.
If getWebhookInfo shows an unfamiliar domain, or the url keeps going empty, hunt down every place the token has been pasted and shut those consumers down.
Fix 5: reset cleanly with deleteWebhook
When the registration is stale or set by hand, clear it and let n8n set it again:
# 1. Unpublish the workflow that holds the Telegram Trigger, then:
curl -s https://api.telegram.org/bot<TOKEN>/deleteWebhook
# 2. Confirm url is now empty
curl -s https://api.telegram.org/bot<TOKEN>/getWebhookInfo
# 3. Publish the workflow in n8n, then run getWebhookInfo again
Add ?drop_pending_updates=true to step 1 only if you want to throw away queued messages.
Why not just setWebhook to your n8n URL yourself? Because n8n won’t accept it. Per the node source, when n8n registers the webhook it sends a secret_token built from the workflow and node IDs. Telegram then sends that value in the X-Telegram-Bot-Api-Secret-Token header, and from node version 1.1 the trigger answers anything without a match with 403 {"message":"Provided secret is not valid"}. A hand-made setWebhook has no matching secret, which is exactly the “Wrong response from the webhook: 403 Forbidden” error people post on the n8n forum.
Worked example: a weekend outage and lost messages
A founder runs a support bot on self-hosted n8n. On Friday at 6 p.m. they debug on the canvas, which re-points the bot to the test URL, and leave for the weekend. On Saturday at 9 p.m. they notice and republish.
- Downtime: Friday 6 p.m. to Saturday 9 p.m. = 27 hours.
- Telegram keeps undelivered updates for at most 24 hours (per the Bot API docs), so messages from the first 3 hours (6 to 9 p.m. Friday) are gone whatever happens.
- It’s worse than that. Per the source, node version 1.3 and later send
drop_pending_updates: truewhen registering the webhook. Republishing a current trigger clears the queue, so the other 24 hours of messages are discarded too, unless the founder pulls them first (remove the webhook without dropping updates, then callgetUpdates).
The fix is cheap: a second bot for testing, plus the hourly health-check workflow alerting on /webhook-test/ or a growing pending_update_count. (Illustrative scenario; your times will differ.)
Who this guide is for, and who it isn’t
- For: self-hosters on Docker, a VPS or a home server behind nginx, Caddy or Traefik; anyone whose bot works on the canvas but not in production.
- Not for: n8n Cloud users seeing TLS or “HTTPS URL must be provided” errors. Cloud handles HTTPS, so look at Fixes 3 to 5 instead.
- Building a bot for customers, not just yourself? If WhatsApp is on the table too, compare the running costs in n8n WhatsApp chatbot cost. If the problem is a plain Webhook node rather than Telegram, see n8n production webhook not working.
Notes for US, Canada and Australia
None of this varies by country: Telegram’s rules and n8n’s behavior are the same everywhere. One practical point for Vancouver, Toronto, Sydney or Perth founders self-hosting: set GENERIC_TIMEZONE to your own zone (our compose file uses America/Toronto as a placeholder) so schedules and timestamps in your bot workflows match your day. More on the self-hosting trade-offs in the AI automation hub.
General information for founders running n8n, not professional advice. n8n and Telegram change their APIs; confirm against the docs for your version. Checked on 4 Nov 2026.
Frequently asked questions
Why does my n8n Telegram Trigger work in test but not in production?
How do I fix 'Bad Request: bad webhook: An HTTPS URL must be provided for webhook'?
Can the n8n Telegram Trigger work on localhost?
How do I change the Telegram webhook URL in n8n?
Does the n8n Telegram Trigger support polling instead of webhooks?
Why does getWebhookInfo show 'Wrong response from the webhook: 403 Forbidden'?
Sources
- 1. Telegram Trigger node (n8n Docs) docs.n8n.io
- 2. Telegram Trigger common issues (n8n Docs) docs.n8n.io
- 3. Configure webhook URLs with reverse proxy (n8n Docs) docs.n8n.io
- 4. Endpoints environment variables (n8n Docs) docs.n8n.io
- 5. Telegram Bot API: setWebhook, deleteWebhook, getWebhookInfo core.telegram.org
- 6. Marvin's Marvellous Guide to All Things Webhook (Telegram) core.telegram.org
- 7. TelegramTrigger.node.ts (n8n source on GitHub) github.com
- 8. Telegram GenericFunctions.ts, getSecretToken (n8n source on GitHub) github.com
- 9. Issue #13682: Telegram HTTPS bug, running in localhost (n8n GitHub) github.com
- 10. Telegram Trigger works only in Test mode but not after activation (n8n Community, Jul 2026) community.n8n.io
- 11. Telegram triggers don't work: 403 and --tunnel (n8n Community) community.n8n.io
- 12. reverse_proxy directive (Caddy Docs) caddyserver.com
Founder, unboxth
Saksham Dogra is the founder of unboxth. He writes founder to founder about building an AI startup from anywhere: company setup, costs, tools and fundraising.