Tunneling question

We’re working to create a new Node integration which requires OAuth2 to authenticate.
The Issue We’re facing is related to the callback URL.

In order to be able to run this locally, we’d have to use the tunnel feature to get a response from the authentication. But that’s not possible if the Tunnel Subdomain is not static. We tried setting the environment variables ‘ N8N_TUNNEL_SUBDOMAIN‘ ,‘WEBHOOK_TUNNEL_URL’ and ‘WEBHOOK_URL’ but no success on getting a static subdomain. We also tried hardcoding the subdomain that we want, but the app doesn’t start this way (stuck on ‘waiting for tunnel’ step)

Can we get some support on how to have a static callback URL using tunnel in n8n?

Information on your n8n setup

  • n8n version: self-hosted version of n8n embed

Setting the environment variable N8N_TUNNEL_SUBDOMAIN to something like the-subdomain-i-want should return in a tunnel URL https://the-subdomain-i-want.hooks.n8n.cloud/ . I just tested and it works fine.
The environment variables WEBHOOK_TUNNEL_URL or WEBHOOK_URL should in this case not be set at all. n8n will take care of that automatically.
Generally are two things important to mention:

  1. The tunnel is just for testing and development. It should not be used for production workflows
  2. A subdomain can only be chosen if it is not already in use. So if the subdomain “my-subdomain” gets requested but somebody else is already using it, then a random one will be used instead. The tunnel service is sadly also not perfect. If a subdomain does get used and n8n not properly shut down while it gets used (for example putting the computer in sleep mode while it is active) will result in the tunnel service “thinking” that it is still in use and it can so not be reused unless we manually restart our tunnel service server (which would then reset all of them again).