Localhost (http://localhost:5678/) error when using e.g. Slack or Gmail "Send and wait. for response" nodes

Title: Localhost error (http://localhost:5678/) when using e.g. Slack or Gmail “Send and wait for response” nodes

n8n Version: 1.12.4

Instance Type: Self-hosted (Docker with Hostinger)

Problem:

Gmail “Send Message and Wait for Response” node generates approval links pointing to http://localhost:5678 instead of my configured domain, causing “connection refused” errors when recipients click the links.

Environment Variables in docker-compose.yml:

yaml

- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- N8N_EDITOR_BASE_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- N8N_PROXY_HOPS=1
```

Verified inside container via:

bash

docker exec <container_name> printenv | grep -E "N8N_HOST|WEBHOOK_URL|N8N_PROTOCOL|EDITOR|PROXY"

Output confirms variables resolve correctly to subdomain.mydomain.com

What works:

  • Regular Webhook nodes show correct URL (both Test and Production)

  • Accessing n8n via subdomain.mydomain.com works fine

What doesn’t work:

  • e.g. Gmail “Send and Wait for Response” approval links still use localhost:5678

Setup:

  • Docker Compose

  • PostgreSQL database

  • Redis queue mode

Already tried:

  • Cleared browser cache

  • Created new webhook nodes

  • Restarted containers multiple times

  • Restarted VPS

  • Added N8N_PROXY_HOPS=1

Any help appreciated!!! Unfortunately this issue has not been solved also it was mentioned couple of times in the forum here in older threads.

Check if you added the correct redirect URI for your credentials in Google Console(for Gmail).

The redirect URI is usually as follows:

https://your-full-address-here/rest/oauth2-credential/callback

You also have to confirm using the same way for Slack Developer Platform.

Yes, added it in Google Cloud.

Reconnected Google Tools in n8n and still receive the error….

1 Like

Solution found!

The issue was the queue mode of the n8n instance. It finally works after being downgraded via Hostinger!

Hope this helps other people.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.