9 months ago
I keep getting an error with the Telegram trigger. I created the bot correctly, as everything works fine on other services. Please help me solve this problem. When I run the trigger test, this error keeps popping up and I can't continue the process.
Attachments
2 Replies
9 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 n8n with railway - Telegram trigger fails
- 🧵 Unable to Deploy Telegram Bot – Getting an Error
- 🧵 My n8n webhooks don't work
If you find the answer from one of these, please let us know by solving the thread!
9 months ago
Here are the main reasons this happens and how to fix it:
1. Your webhook URL must be HTTPS and publicly accessible
- Telegram only accepts HTTPS URLs with a valid SSL certificate.
- Localhost (
http://127.0.0.1:xxxx) or non-HTTPS endpoints won’t work. - Check that your Railway app is deployed and running, and the URL in the error (
https://primary-production-…up.railway.app/webhook…) is accessible in a browser.
👉 Try opening that exact link in your browser — you should see at least some response. If it 404s or times out, Telegram will reject it.
2. Only one webhook per bot
- If you previously set a webhook for the same bot (maybe in another service), Telegram won’t overwrite it unless you explicitly reset it.
- Run this in a browser (replace
<BOT_TOKEN>with yours):
https://api.telegram.org/bot<BOT_TOKEN>/deleteWebhook
Then retry setting it up in your Railway trigger.
3. Correct format of the webhook endpoint
- Telegram requires the endpoint to be just a URL, no query string weirdness, no fragments. Example:
https://your-app.up.railway.app/webhook/<BOT_TOKEN> - Some automation platforms auto-generate a webhook path. Make sure your server actually handles POST requests at that path.
4. Bot token in the right place
- Make sure your Railway environment variables include
BOT_TOKEN, and that your code (or the trigger config) is inserting it correctly. - If the token is missing, Telegram might see the webhook as malformed.
🔧Quick test to verify your webhook URL
Run this in your browser or curl (replace with your bot token & URL):
https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://your-app.up.railway.app/webhook
If Telegram responds with {"ok":true,"result":true,"description":"Webhook was set"} → then your URL is valid.