I am trying to call a n8n Webhook from a local instance when WEBHOOK_URL is set on my environment variables in swarm mode. http://localhost:5678 does not work neither does port 80, 443 or 5679.
I always get:
401 - "Unauthorized"
Is there maybe another port for the webhook url, which is configured on traefik or any other trick to get it working and successfully contact my webhook worker?
I am not using authentification. I am using the WEBHOOK_URL parameter as ENV in Docker so the webhook url is different from the n8n gui url, so when on the same machine calling localhost:5678 can reach only test webhooks or api (meaning the main n8n service) and no production webhooks or wait webhooks on the n8n webhook service.
Maybe the production webhook using WEBHOOK_URL parameter, on the n8n webhook service, is using a different port, but for that I could not find any documentation and also going through docker logs and container details, did not give me any hint.
Have you managed to GET/POST a production webhook via n8n on the same instance using WEBHOOK_URL parameter and localhost:5678?
That is pretty much how all of my test n8n instances run, I use localhost to access it while fixing issues and all of my webhook urls go to https://n8n-dev.mydomain.com which is sent to my laptop on port 5678 from my reverse proxy.
The 401 is a pretty standard authentication error though, What happens if you access your webhook_url does it load the main n8n instance or do you have traefik configured to only direct /webhook to your n8n instance?
Are you sure the rule is working? What happens if you just load the webhook url in your browser without the rest of the path does that show that n8n login screen?
I wouldn’t have expected the browser to say it can’t get /prod if you didn’t include it in the url, but I also can’t see anything in your Traefik config that says if the url contains /prod it should direct to the worker.
Calling any test webhook also works using “localhost:5678/webhook-test”
But calling any production webhook from inside the n8n instance is not possible
My goal was:
Starting a Workflow with a Wait Webhook inside
Editing another webhook on the beginning via n8n node and enter the wait webhook into the other webhooks http request node
when the other webhook activates it calls the before entered wait webhook url (which is not working)
then usually the base workflow should continue if the webhook would be callable internally
I solved this by a dirty workaround getting execution data from the other workflow instead of using the wait webhook, but thats not really reliable when many concurrent executions are there and only one is the correct one.
Alright so when you called webhook.n8n.mydomain.com which I assume isn’t really the N8N_WEBHOOK_SUBDOMAIN but more the mix of N8N_WEBHOOK_SUBDOMAIN and DOMAIN_NAME in your browser and you got the Cannot GET /prod message where did the /prod come from?
Did you actually use webhook.n8n.mydomain.com/prod instead?
When you say everything from outside the n8n domain what do you actually mean? Do you just mean like the 3rd option says it only actually fails when ran from inside an n8n workflow? If that is the case what is the output when you set n8n to output the full response does it show anything unexpected?
That doesn’t really answer the actual question I asked sadly. When you ented the url did you add /prod at the end or did you just use the webhook.n8n.mydomain.com address?
This potentially doesn’t matter though depending on the answer to the other questions I asked.