Tunnel URL return 504 gateway timeout

Hi N8N Team,

I’m new to n8n and coding overall, so excuse me for my dumb-dumb questions. I have been working around and trying with n8n low code using community selfhost on locally. I have not success with webhook through n8n’s tunnel.

Describe the problem/error/question

Recently, I’ve try to create workflow with telegram triggered node but fail to get the node receive any msg from the bot. With further investigation, i found out that the webhook/URL of the node is unable to access (I know this is due to local start and not with tunnel). Then I start n8n with tunnel and it gives the Tunnel URL: https://[Token].hooks.n8n.cloud/
I then try to get access to n8n through that url on the browser. After a while it return 504 error code instead of n8n.
I questioned what if i tried to use another tunnel instead. I then switch to Ngrok to forward the port, and test with Webhooks node and it works.
Some more learning from n8n docs, I acknowledge that if I wanted to use Ngrok for webhooks and other nodes that required webhooks and APIs (right?), I have to change the WEBHOOKS_URL variable with the Ngrok’s url.
→ From there I raised 2 questions:

  • If I want to use other tunnel like Cloudflare, Ngrok, … (en-light me more service that i can use please) ; then i have to change the WEBHOOKS_URL in the .env file? Is there anymore i have to make change to get it working with others tunnel services?
  • Where can i find the .env file? What do I have to look out for when setting the variable in the .env file?
  • If I want to use triggered node other than the webhook triggered its self, I do have to change the WEBHOOKS_URL variable?

What is the error message (if any)?

504 error

Ping the URL provided by n8n tunnel service:

Please share your workflow

Information on your n8n setup

  • n8n version:1.76.2
  • Database (default: SQLite): [default]
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm?, selfhost local machine
  • Operating system: Window 11

Regards,
Peter

Welcome to the community :tada:

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!


There are no dumb questions so don’t feel scared to ask anything here, that’s what this place is for.

  • setting theWEBHOOK_URL in the .env file should be enough, and no additional changes should be required for other tunnel services.
  • you’ll need to create your own .env file and that would depend on your setup. See this page: Configuration methods | n8n Docs
  • What other trigger node are your referring to? The WEBHOOK_URL variable defines the base URL for the webhook endpoints so if you’re using other types of trigger nodes like the schedule trigger then you won’t need to change that.

Hope that helps!

Were you able to solve the problem? How did you do it?