Waiting webhook links use localhost in “Send and wait” emails despite correct WEBHOOK_URL and N8N_EDITOR_BASE_URL

Describe the problem/error/question

In production, the “Send and wait” (Gmail node) generates waiting webhook links that point to http://localhost:5678/webhook-waiting/... instead of my public URL https://n8n.pulseflow.ch.

All other webhooks display correctly (trigger functions etc.)

What is the error message (if any)?

No error message, but the approval/response link in the email is invalid because it points to localhost.

Example link from email:
http://localhost:5678/webhook-waiting//?approved=true&signature=…

Expected:

Please share your workflow

Here is the Gmail node config (simplified):

{
  "nodes": [
    {
      "parameters": {
        "operation": "sendAndWait",
        "sendTo": "[email protected]",
        "subject": "Approval",
        "message": "Approval email content...",
        "responseType": "customForm",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Confirm?",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  { "option": "Yes" },
                  { "option": "No" }
                ]
              }
            }
          ]
        }
      },
      "id": "a00ec081-07c0-4f8a-9139-6606a65236ff",
      "name": "Send Content Confirmation",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1
    }
  ]
}

Share the output returned by the last node
Email is successfully sent, but the approval link is broken (points to localhost).

Information on your n8n setup
n8n version: 1.114.4

Database: Postgres

n8n EXECUTIONS_PROCESS: queue (workers enabled)

Running via: Docker behind reverse proxy (TLS terminates at proxy)

Operating system: Linux (containerized)

Relevant environment variables (set on ALL containers: main + workers):

N8N_EDITOR_BASE_URL=https://n8n.pulseflow.ch
WEBHOOK_URL=https://n8n.pulseflow.ch/
N8N_HOST=n8n.pulseflow.ch
N8N_PROTOCOL=https
N8N_PORT=5678   # proxy handles 443
GENERIC_TIMEZONE=Europe/Berlin
N8N_BLOCK_ENV_ACCESS_IN_NODE=true
N8N_ENCRYPTION_KEY=...

Diagnostics
/rest/settings confirms correct values:

urlBaseEditor: https://n8n.pulseflow.ch

urlBaseWebhook: https://n8n.pulseflow.ch/

endpointWebhookWaiting: webhook-waiting

Proxy forwards Host and X-Forwarded-Proto.

Restarted all containers and re-triggered new executions.

Verified envs are present in both main + worker containers via printenv.

Issue persists: email links still show http://localhost:5678.

Question
In queue mode, do workers need an additional env var (besides WEBHOOK_URL / N8N_EDITOR_BASE_URL) for waiting link generation?

Is this a bug in how workers build sendAndWait webhook links?

Any known fixes/workarounds for this?

Thanks a lot 🙏

Hi @RainyDev

According to the docs:

  • Set the N8N_PROXY_HOPS environment variable to 1.

Hi @mohamed3nan

Thanks for your quick response!
I set the ENV, unfortunately still the same issue.

Somehow its only the /webhook-waiting Webhook im facing this issue with. All other sorts of webhooks get displayed correctly which adds some confusion to me.

Any other ideas?

Best regards

Please have you been able to fix this error?

I also have this when using the “Send and Wait for Response” operation on the “Send a text message” Node of Telegram.

Very confusing as my WEBHOOK_URL is properly set and works for webhook nodes.

N8N_PROXY_HOPS’s value is 1

Could anyone fix this in the meantime?

Also facing the exact same issue - it works with regular webhook nodes but e.g. not with Gmail, Slack etc (hint: Redirect URLs are added there)