Problems with telegram webhook

hello I am new to n8n, I am using n8n locally and ngrok to expose locally with https the problem is that the telegram node does not let me alter the webhook in any way which makes me throw the error Problem running workflow

Bad request - please check your parameters

Show Details

Telegram Trigger: Bad Request: bad webhook: An HTTPS URL must be provided for webhook

(at least that’s what I think is happening)

if anyone has any ideas please help me at this point I’m a bit desperate.

2 Likes

Hello @JackCenteno welcome

Share your workflow so we can see how we can help

1 Like

Hi. You can not run a Telegram Trigger if you call n8n via “localhost”. You need to use HTTPS.

Search for “n8n docker to https”

M.

But I’m using ngrok and it takes care of the HTTPS part externally In that case, I wouldn’t need to configure HTTPS directly inside the Docker environment for webhooks to work,
the problem is that webhook_url is not set by me, it sets the "http://localhost:5678/webhook-test/538479f5-ce98-4510-9c94-444b0f5dd085/webhook " automatically every time I create a Telegram node and it doesn’t let me change it

It is that there is no flow XD I’m just starting to learn, and I wanted to start to see how to make the Telegram bot but I can’t get the first telegram node to work, the one that connects to the bot because the n8n does not connect to the bot and webhook_url, it puts the automatically every time I create a Telegram node and does not let me change it,

Use the published webhook URL and connection between telegram and webhook must be over HTTPS

thanks to all who wrote, someone sent me an msm with the answer, for whoever is interested it was to create an env in the source folder of n8n with these parameters
N8N_HOST= “link ngrok”
WEBHOOK_URL=“link ngrok”/
N8N_PROTOCOL=https

there is a defect is that if you change the ip of the ngrok you also have to change it in the env.

3 Likes

Hi, I use Telegram on N8N like this:

Add to the Telegram chat or group I want to get information for automation,
Then send a message to log changes.
Then check the chat ID from this website.
Steps:
Create a bot in Telegram using BotFather:
Type /start and then /newbot.
Follow the instructions and get the bot token (something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11).
Add the bot to a Telegram group and get the chat ID:
Send a message to the group and use the API (https://api.telegram.org/bot<your_token>/getUpdates) to see the chat ID.
This query returns a JSON, and there you’ll find the chat ID (usually starting with a “-” and numbers).
Then in n8n, in the Telegram trigger node, you set the ID.

I hope I’ve guided or helped you.
Regards

Thank you so much! I have been scratching my head but this worked!

Thanks, this work for me.

N8N_HOST=“ngrok URL”
WEBHOOK_URL=“ngrok URL”/
N8N_PROTOCOL=https

Its the same, but with " " instead of “ ”

this changed the webhook URL on my Telegram Trigger, but a still get the webhook error msg


there is a double quote after the app in the url.

should not have it.

1 Like

Update:

Thx @darrell_tw,

i had to remove the double quote at the end of the URL on the second Line:

N8N_HOST=“ngrokURL”
WEBHOOK_URL="ngrokURL/
N8N_PROTOCOL=https

Hi, im using render.com
any ways to help with my case, i faced the same issue like yours.

1 Like

let me help u, watch this video, especially the end of it. he shows how to fix the webhook problem…. https://www.youtube.com/watch?v=uDThg7sG3pU

Hi mate, it is not like that but like this for me.
If you c/p the below,

- N8N_HOST=URL #without https://

- WEBHOOK_URL=https://URL

- N8N_PROTOCOL=https

I hope this helps you and others.
Have a wonderful day.