My config file pm2
module.exports = {
apps: [
{
name: 'n8n-main',
script: 'n8n',
args: '',
instances: 1,
exec_mode: 'fork',
env: {
NODE_ENV: 'production',
N8N_PORT: 5678,
EXECUTIONS_MODE: 'queue',
N8N_SECURE_COOKIE: 'false',
// Redis configuration
QUEUE_BULL_REDIS_HOST: 'localhost',
QUEUE_BULL_REDIS_PORT: 6379,
QUEUE_BULL_REDIS_DB: 0,
// Database
DB_TYPE: 'postgresdb',
DB_POSTGRESDB_HOST: 'localhost',
DB_POSTGRESDB_PORT: 5432,
DB_POSTGRESDB_DATABASE: 'n8n',
DB_POSTGRESDB_USER: 'n8n_user',
DB_POSTGRESDB_PASSWORD: 'MonMotDePasseSecurise123!',
// Encryption key
N8N_ENCRYPTION_KEY: 'vGluJdTZ1rWDnytZT3X7D02l33OQ13aE'
}
},
{
name: 'n8n-worker',
script: 'bash',
args: '-c "sleep 5 && n8n worker --concurrency=1"',
instances: 1,
exec_mode: 'fork',
env: {
NODE_ENV: 'production',
EXECUTIONS_MODE: 'queue',
// Redis configuration
QUEUE_BULL_REDIS_HOST: 'localhost',
QUEUE_BULL_REDIS_PORT: 6379,
QUEUE_BULL_REDIS_DB: 0,
// Database
DB_TYPE: 'postgresdb',
DB_POSTGRESDB_HOST: 'localhost',
DB_POSTGRESDB_PORT: 5432,
DB_POSTGRESDB_DATABASE: 'n8n',
DB_POSTGRESDB_USER: 'n8n_user',
DB_POSTGRESDB_PASSWORD: 'MonMotDePasseSecurise123!',
// Encryption key
N8N_ENCRYPTION_KEY: 'vGluJdTZ1rWDnytZT3X7D02l33OQ13aE'
}
}
]
};
i have this error, whereas i run pm2 logs :
1|n8n-worker | n8n Task Broker’s port 5679 is already in use. Do you have another instance of n8n running already?
PM2 | App [n8n-worker:1] exited with code [1] via signal [SIGINT]
PM2 | App [n8n-worker:1] starting in -fork mode-
PM2 | App [n8n-worker:1] online
1|n8n-worker | Last session crashed
and i don’t understand why :
just with this workflow
My workflow(5).json (1.6 KB)
i don’t understand why,


