Webhook Scaling Issues

Hello!

I’ve been testing out setting up scaling on a self hosted instance following the Scaling guide in the docs.
I’ve successfully set up a worker to handle executions but I’m having issues getting the webhook processor to work.

I have a loadbalancer (Traefik) working correctly as it reaches the Webhook processor but I am not seeing anything happening on the redis server and then I recieve an error page.

The Environmental variables for the webhook processor instance are:

N8N_ENCRYPTION_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DB_TYPE=postgresdb
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_HOST=x.x.x.x
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_USER=user
DB_POSTGRESDB_PASSWORD=password
QUEUE_BULL_REDIS_HOST=x.x.x.x
QUEUE_BULL_REDIS_PORT=6379
QUEUE_BULL_PREFIX=webhook
WEBHOOK_URL=https://subdomain.domain.com/

Env for main process:
N8N_BASIC_AUTH_ACTIVE:true,
N8N_BASIC_AUTH_USER:“user”,
N8N_BASIC_AUTH_PASSWORD:“password”,
WEBHOOK_URL: “https://subdomain.domain.com/”,
N8N_LISTEN_ADDRESS: “0.0.0.0”,
N8N_ENDPOINT_WEBHOOK: “api”,
N8N_ENDPOINT_WEBHOOK_TEST: “api-test”,
N8N_METRICS:true,
N8N_PAYLOAD_SIZE_MAX:32,
DB_TYPE:“postgresdb”,
DB_POSTGRESDB_DATABASE:“n8n”,
DB_POSTGRESDB_HOST:“x.x.x.x”,
DB_POSTGRESDB_PORT:“5432”,
DB_POSTGRESDB_USER:“user”,
DB_POSTGRESDB_PASSWORD:“password”,
NODE_FUNCTION_ALLOW_EXTERNAL:“uuid”,
QUEUE_BULL_REDIS_HOST:“localhost”,
QUEUE_BULL_REDIS_PORT:“6379”,
EXECUTIONS_MODE:“queue”,
N8N_DISABLE_PRODUCTION_MAIN_PROCESS:“false”

When hitting the production link for a webhook I get this simple error:
“Cannot GET /api/test”
With a 404 error code.
I can’t seem to pinpoint the issue it may be with redis but I’m not getting any errors associated to redis just an absence of activity.
Or its acting like its own instance and not talking to the main instance at all.

If anyone has any ideas what may be going wrong/ I am doing wrong or has any insight into how the Webhook processors work I’d be greatful to hear it.

Thanks in advance!

Information on your n8n setup

  • n8n version:0.157.1
  • Database you’re using (default: SQLite):Postgres
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:npm

Hi @Jaime_B, is the workflow containing your webhook node active? This would be indicated by a green background on the toggle in the upper right corner of your canvas:
image

For deactivated workflows, a 404 response would be expected when hitting a webhook’s production URL.

Hi @MutedJam,

Yes its currently active, I also tested it without the webhook processor and it functions normally.

I’m not sure if I’ve missed something in the docs as it seems to all be correctly set up.

I found the issue for anyone who may make a similar mistake!

I forgot to set the env variables:
N8N_ENDPOINT_WEBHOOK: “api”,
N8N_ENDPOINT_WEBHOOK_TEST: “api-test”,
on the webhook processor!

2 Likes