Workflows execute 3 times instead of 1 in Queue Mode (v1.95.1) - All instances (main & workers) start active workflows #15878
Labels
in linear
Issue or PR has been created in Linear for internal review
Bug Description
In a Docker Compose setup with one main n8n instance and two worker instances configured for queue mode, all three instances (main, worker-1, and worker-2) are logging "Start Active Workflows:" and listing all active workflows. This leads to workflows being triggered or processed multiple times (seemingly three times, once by each instance). The worker instances are not correctly deferring workflow activation to the main instance, despite appropriate environment variable settings. This behavior was observed in v1.94.1 and persists after upgrading to v1.95.1.
To Reproduce
Steps to reproduce the behavior:
Set up a Docker Compose environment with one n8n main instance and at least one n8n worker instance (e.g., n8n-worker-1).
Configure all instances for queue mode using Redis, with the following key environment variables:
Main instance (n8n):
N8N_PROCESS=main
EXECUTIONS_MODE=queue
N8N_DISABLE_ACTIVE_WORKFLOWS=false
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
(Relevant QUEUE_BULL_REDIS_* variables)
Worker instance(s) (n8n-worker-1, n8n-worker-2):
N8N_PROCESS=worker
EXECUTIONS_MODE=queue
N8N_DISABLE_ACTIVE_WORKFLOWS=true
(Relevant QUEUE_BULL_REDIS_* variables)
N8N_SKIP_WEBHOOK_REGISTRATION_ON_STARTUP=true
N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN=true
Start the Docker Compose stack (docker-compose up -d).
Observe the logs for the main n8n container and the n8n-worker-1 (and any other worker) containers.
See error: All instances (main and workers) will output the "Start Active Workflows:" banner and list all active workflows. Any trigger (e.g., a cron, webhook, or manual execution) will likely result in the workflow being processed by all three instances.
Expected behavior
Only the main n8n instance (configured with N8N_PROCESS=main and N8N_DISABLE_ACTIVE_WORKFLOWS=false) should log "Start Active Workflows:" and be responsible for activating/scheduling workflows.
Worker instances (configured with N8N_PROCESS=worker and N8N_DISABLE_ACTIVE_WORKFLOWS=true) should not log "Start Active Workflows:" and should only pick up and process jobs from the Redis queue. Workflows should only execute once, processed by an available worker.
docker-compose_lastQueue_31-05.yml.txt
code (5).txt
code (4).txt
code (3).txt
Operating System
Ubuntu 24
n8n Version
1.95.1
Node.js Version
18.13
Database
PostgreSQL
Execution mode
queue
The text was updated successfully, but these errors were encountered: