I am unable to run queue mode

I have tried running the n8n main process and worker process directly as well as using docker. But unable to run it. It doesn’t start the queue mode and runs in regular mode.

I am sharing the docker-compose file here. Kindly help me out as this is very urgent for us.

Information on your n8n setup

  • **n8n version: latest
  • **Database you’re using : postgres on docker
  • **Running n8n with the execution process [own(default), main]: unchanged, so should be ‘own’ by default
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker

docker-compose.yml:

version: '3.1'

services:

  postgres:
    image: postgres:11
    restart: always
    environment:
      - POSTGRES_USER=dbroot
      - POSTGRES_PASSWORD=dbrootpassword
      - POSTGRES_DB=n8n
      - POSTGRES_NON_ROOT_USER=dbuser
      - POSTGRES_NON_ROOT_PASSWORD=dbpassword
    ports:
      - 5432:5432
    volumes:
      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh

  n8n:
    image: n8nio/n8n
    restart: always
    environment:
      - N8N_USER_MANAGEMENT_DISABLED=true
      - N8N_DIAGNOSTICS_ENABLED=false
      - N8N_PERSONALIZATION_ENABLED=false
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_PORT=5432
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_PROCESS=main
      - QUEUE_BULL_REDIS_PORT=6379
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=dbroot
      - DB_POSTGRESDB_PASSWORD=dbrootpassword
      - DB_POSTGRESDB_HOST=postgres
      - QUEUE_BULL_REDIS_HOST=redis
      - QUEUE_BULL_REDIS_DB=0
      - DB_LOGGING_MAX_EXECUTION_TIME=0
      - N8N_LOG_LEVEL=error
      - EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
      - EXECUTIONS_DATA_SAVE_ON_ERROR=none
      - N8N_DISABLE_PRODUCTION_MAIN_PROCESS=true
    ports:
      - 5678:5678
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"
    depends_on:
      - postgres
      - redis
    volumes:
      - ./appdata:/home/node/.n8n
    # Wait 5 seconds to start n8n to make sure that PostgreSQL is ready
    # when n8n tries to connect to it
    command: /bin/sh -c "sleep 5; n8n start"

  redis:
    ports:
      - 6379:6379
    image: redis:alpine

  n8n-worker:
    image: n8nio/n8n
    restart: always
    environment:
      - N8N_USER_MANAGEMENT_DISABLED=true
      - N8N_DIAGNOSTICS_ENABLED=false
      - N8N_PERSONALIZATION_ENABLED=false
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_PORT=5432
      - EXECUTIONS_MODE=queue
      - EXECUTIONS_PROCESS=main
      - QUEUE_BULL_REDIS_PORT=6379
      - QUEUE_BULL_REDIS_DB=0
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=dbroot
      - DB_POSTGRESDB_PASSWORD=dbrootpassword
      - DB_POSTGRESDB_HOST=postgres
      - QUEUE_BULL_REDIS_HOST=redis
      - DB_LOGGING_MAX_EXECUTION_TIME=0
      - N8N_LOG_LEVEL=error
      - EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
      - EXECUTIONS_DATA_SAVE_ON_ERROR=none
      - QUEUE_HEALTH_CHECK_ACTIVE=true
    ports:
      - 5679:5678
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"
    volumes:
      - ./appdata:/home/node/.n8n
    # Wait 5 seconds to start n8n to make sure that PostgreSQL is ready
    # when n8n tries to connect to it
    command: /bin/sh -c "sleep 5; n8n worker"

Please try running this docker-compose.yml file

Hey @reev,

Welcome to the community :raised_hands:

When you say you are unable to run queue mode what do you mean? Where are you seeing it running in regular mode?

worker process doesn’t show any execution.
Also, When i tried without running the worker, the workflows got executed

Hi @reev,

When you ran the workflows was that with a trigger of some kind? If you press the execute workflow button it will run on the main instance and the same for testing any webhooks or triggers. Once the workflows are marked as “active” they should then be handled by the worker node.

oh ok.
Let me try that and will update here.
Thanks

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.