I have n8n deployed on Coolify and I’m having trouble getting the worker queue functionality to work properly. The main problem is that my workflows are still being processed by the primary n8n container instead of being distributed to worker instances.
Current behavior:
- Workflows execute but seem to run on the main container
- Execute button shows loading spinner that never completes unless I refresh the page
- Redis container shows no activity in logs
- Worker containers remain idle with no job processing
- Main n8n logs confirm queue mode is enabled
My configuration:
services:
automation-main:
image: docker.n8n.io/n8nio/n8n
environment:
- SERVICE_FQDN_AUTOMATION_5678
- 'N8N_EDITOR_BASE_URL=${SERVICE_FQDN_AUTOMATION}'
- 'WEBHOOK_URL=${SERVICE_FQDN_AUTOMATION}'
- 'GENERIC_TIMEZONE=${TIMEZONE:-UTC}'
- 'TZ=${TIMEZONE:-UTC}'
- DB_TYPE=postgresdb
- 'DB_POSTGRESDB_DATABASE=${DB_NAME:-automation}'
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_USER=$DB_USER
- DB_POSTGRESDB_SCHEMA=public
- DB_POSTGRESDB_PASSWORD=$DB_PASSWORD
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=cache
- QUEUE_BULL_REDIS_PORT=6379
- QUEUE_MODE=redis
- N8N_RUNNERS_ENABLED=true
- QUEUE_HEALTH_CHECK_ACTIVE=true
- N8N_LOG_LEVEL=verbose
volumes:
- 'app-data:/home/node/.n8n'
command: start
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
automation-worker:
image: docker.n8n.io/n8nio/n8n
environment:
- 'GENERIC_TIMEZONE=${TIMEZONE:-UTC}'
- DB_TYPE=postgresdb
- 'DB_POSTGRESDB_DATABASE=${DB_NAME:-automation}'
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_USER=$DB_USER
- DB_POSTGRESDB_PASSWORD=$DB_PASSWORD
- EXECUTIONS_MODE=queue
- QUEUE_BULL_REDIS_HOST=cache
- QUEUE_BULL_REDIS_PORT=6379
- QUEUE_MODE=redis
- N8N_WORKER=true
- N8N_LOG_LEVEL=verbose
volumes:
- 'app-data:/home/node/.n8n'
command: worker
depends_on:
postgres:
condition: service_healthy
cache:
condition: service_healthy
postgres:
image: 'postgres:15-alpine'
volumes:
- 'db-data:/var/lib/postgresql/data'
environment:
- POSTGRES_USER=$DB_USER
- POSTGRES_PASSWORD=$DB_PASSWORD
- 'POSTGRES_DB=${DB_NAME:-automation}'
cache:
image: redis:6
volumes:
- cache_storage:/data
Troubleshooting done:
- Verified all environment variables are set correctly
- Confirmed Redis and PostgreSQL connections work
- Checked that both main and worker containers start without errors
- Reviewed Docker networking within Coolify
I’m wondering if this could be related to Coolify’s internal container communication or if there’s a specific configuration needed for queue mode to work in this environment. Anyone had success with similar setup?