Hello!
I am running n8n in Test URL mode with the Telegram Trigger. I am using free ngrok to forward traffic to my local Python server on port 5555.
I am receiving the error: Telegram Trigger: Bad Request: invalid webhook URL specified.
Here is what I have already done (and confirmed to be working):
I manually deleted the Webhook in Telegram and received confirmation.
I confirmed that ngrok is running and reporting Session Status: online.
I manually set the full Webhook URL in Telegram using the /setWebhook command and received confirmation: {“ok”:true, “result”:true, “description”:“Webhook was set”}.
The Problem: Despite the successful manual setup, when I click “Execute workflow”, n8n still throws the error. It seems n8n is unable to validate or register the active ngrok address.
Question: What is the correct procedure to properly bypass or resolve this error when using a temporary ngrok address in the Telegram Trigger’s test mode?
Based on the search results, it looks like you’re running into a common issue with n8n’s webhook URL configuration. Even though you’ve manually set the webhook in Telegram successfully, n8n needs to know about your ngrok URL to properly handle the webhook requests.
You need to set the `WEBHOOK_URL` environment variable when starting n8n. Try this:
• Stop your current n8n instance
• Set the environment variable: `WEBHOOK_URL=https://your-ngrok-url.ngrok.io`
• Restart n8n with this environment variable set
• The Telegram Trigger should now use your ngrok URL instead of localhost
According to [community.n8n.io]( How to use ngrok for HTTPS in Telegram Trigger Webhook? ), you can start n8n with: `WEBHOOK_URL=https://your-ngrok-url.ngrok.io n8n start` if you’re using npm, or add the environment variable to your Docker command if using Docker.
The key issue is that n8n constructs webhook URLs from its internal configuration, so without setting `WEBHOOK_URL`, it will always try to use `http://localhost:5678` even if you’ve manually configured Telegram correctly.