I’m facing a frustrating issue with Telegram Trigger in a production deployment of n8n (v1.83.2) hosted via Railway (Docker).
Here’s what’s happening:
• I’ve set up the Telegram Trigger node.
• When I activate the workflow, it still keeps the Test URL under Webhook URLs.
• Even when I manually switch to Production URL, it resets back to Test after a page reload or deactivation.
• When I call the Telegram setWebhook with the Production URL, Telegram confirms it’s set. But when a message is sent to the bot, nothing happens.
• If I access the production webhook URL directly, I get this:
The workflow is definitely active and green.
• Logs confirm that the workflow starts correctly on Railway.
I also completely reinstalled Railway CLI, cleared environment variables, and even rebuilt the container. Still no success.
Question:
Why does the Telegram Trigger always revert to the Test URL, and how can I ensure it uses the Production URL properly and registers with Telegram?
Would really appreciate any ideas or if someone from the team can help debug this!
This behavior usually happens when the Telegram Trigger node never properly switches to production mode on activation. Even if the workflow is marked as “active,” the webhook URL sticking to the test one means n8n isn’t registering it correctly under the production endpoint internally.
Here’s what might be going wrong and how to approach it:
First, n8n only uses the production webhook URL when the workflow is both activated and deployed in a mode where webhook URLs are stable and public (not localhost or ephemeral). Railway sometimes introduces issues here if the public URL changes or if the webhook endpoint isn’t consistently reachable from Telegram’s side.
Now, when you activate the workflow and it still shows the test URL, that’s a strong sign that n8n doesn’t detect a stable deployment environment. This can be due to:
– not setting WEBHOOK_URL explicitly
– Railway assigning a dynamic URL that n8n can’t resolve at startup
– internal networking config in Railway causing n8n to misreport its base URL
You’ll want to explicitly set WEBHOOK_URL in your Railway service environment. For example: https://your-app-name.up.railway.app/
Once set, restart the container so n8n picks it up at boot. Then deactivate and reactivate the Telegram-triggered workflow. That should regenerate the webhook under the correct production URL.
Also double-check that you’re not running in tunnel or test mode locally, and that you haven’t overridden NODE_ENV in a way that interferes with n8n’s behavior.
To confirm it’s fixed, activate the workflow, refresh the page, and check that the production URL still shows. Then check Telegram’s getWebhookInfo response to make sure it’s using the correct one.
Let me know if you want help validating the config or decoding the webhook status from Telegram’s side.