Thank you @Jekylls
Yes, we are trying to achieve the same. We are using Enterprise Edition of n8n for Production where we start 5 workers each with concurrecny limit of 50.
Common configuration for both Main and Worker instances:
DB_TYPE postgresdb
N8N_BLOCK_ENV_ACCESS_IN_NODE false
Path C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Users\Administrator\AppData\Roaming\npm
EXECUTIONS_MODE queue
OFFLOAD_MANUAL_EXECUTIONS_T… true
N8N_ENDPOINT http://localhost:5678
N8N_MIGRATE_FS_STORAGE_PATH true
DB_POSTGRESDB_USER n8n_user
QUEUE_BULL_REDIS_HOST localhost
N8N_LOG_LEVEL info
DB_POSTGRESDB_DATABASE n8n_db
N8N_ENCRYPTION_KEY *****
N8N_LOG_OUTPUT console
NODES_EXCLUDE
QUEUE_BULL_REDIS_PORT 6379
DB_POSTGRESDB_HOST localhost
DB_POSTGRESDB_PASSWORD n8n
DB_POSTGRESDB_PORT 5432
DB_POSTGRESDB_SCHEMA n8n
PM2 start configuration for Main and Worker instances:
module.exports = {
apps: [
{
name: “n8n-main”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “”,
interpreter: “node”,
instances: 1, // Always keep main as 1
exec_mode: “fork”, // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5679”
}
},
{
name: “n8n-worker-01”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “worker --concurrency 50”,
interpreter: “node”,
instances: 1, //
Scale workers here
exec_mode: “fork”, // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5680”,
N8N_RUNNERS_TASK_BROKER_URI: “127.0.0.1:5680”
}
},
{
name: “n8n-worker-02”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “worker --concurrency 50”,
interpreter: “node”,
instances: 1, //
Scale workers here
exec_mode: “fork”, // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5681”,
N8N_RUNNERS_TASK_BROKER_URI: “127.0.0.1:5681”
}
},
{
name: “n8n-worker-03”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “worker --concurrency 50”,
interpreter: “node”,
instances: 1, //
Scale workers here
exec_mode: “fork” , // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5682”,
N8N_RUNNERS_TASK_BROKER_URI: “127.0.0.1:5682”
}
},
{
name: “n8n-worker-04”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “worker --concurrency 50”,
interpreter: “node”,
instances: 1, //
Scale workers here
exec_mode: “fork”, // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5683”,
N8N_RUNNERS_TASK_BROKER_URI: “127.0.0.1:5683”
}
},
{
name: “n8n-worker-05”,
script: “C:\Users\Administrator\AppData\Roaming\npm\node_modules\n8n\bin\n8n”,
args: “worker --concurrency 50”,
interpreter: “node”,
instances: 1, //
Scale workers here
exec_mode: “fork”, // Important for n8n workers
env: {
N8N_RUNNERS_MODE: “internal”,
N8N_RUNNERS_ENABLED: “true”,
N8N_RUNNERS_BROKER_PORT: “5684”,
N8N_RUNNERS_TASK_BROKER_URI: “127.0.0.1:5684”
}
}
]
};