Following up on these closed topics, since I hit the same issue and found the cause:
- Waiting webhook links use localhost in “Send and wait” emails despite correct WEBHOOK_URL and N8N_EDITOR_BASE_URL
- Localhost (http://localhost:5678/) error when using e.g. Slack or Gmail "Send and wait. for response" nodes
Setup
- n8n version: [2.41.5]
- Self-hosted on Dokploy, Docker Compose stack
- Queue mode (main + worker containers)
- Behind a reverse proxy (TLS terminated at the proxy)
Symptom
Regular Webhook nodes showed the correct public URL. The approval links generated by “Send and wait for response” (SMTP for my case) pointed to http://localhost:5678/webhook-waiting/``....
What didn’t fix it
I set these on the main n8n container only, as the docs describe:
yaml
- N8N_WEBHOOK_URL=https://${N8N_HOST}/
- N8N_PROXY_HOPS=1
(Note: since n8n 2.35.0, N8N_WEBHOOK_URL replaces the deprecated WEBHOOK_URL.)
What fixed it
I added the webhook URL to the worker container as well:
yaml
n8n-worker:
environment:
- N8N_WEBHOOK_URL=https://${N8N_HOST}/
After redeploying, new “Send and wait” executions generated the correct public links.
Why
In queue mode the worker runs the node, so the worker builds the resume/waiting URL ($execution.resumeUrl). If the worker doesn’t have the webhook URL configured, it falls back to the default http://localhost:5678. The main instance builds the regular webhook URLs, which is why those looked fine.
If you’re on an older version that still uses WEBHOOK_URL, the same rule applies: make sure it’s set on every worker, not just main. After changing it, trigger a new execution, because already-waiting executions keep the old link.
Hope this helps someone!