n8n Queue Mode Redis Bug Report
Describe the problem/error/question
ALL workflows fail to execute when n8n is running in queue mode
(N8N_EXECUTIONS_MODE=queue
). The error occurs immediately when any workflow is
triggered (webhooks, manual execution, scheduled triggers, etc.), preventing the
execution from being queued and processed by worker containers. This makes
queue mode completely unusable for production deployments.
What is the error message (if any)?
ERR Error running script (call to 27ea40f2e4444b8c0f37ad29529e79e372dbbc82): @user_script:111: script tried accessing undeclared key, key: bull:jobs:1
Additional error context:
Problem with execution 6180: ERR Error running script (call to 27ea40f2e4444b8c0f37ad29529e79e372dbbc82): @user_script:111: script tried accessing undeclared key, key: bull:jobs:1. Aborting.
Please share your workflow/screenshots/recording
{
"name": "Submission Test Workflow",
"nodes": [
{
"parameters": {
"formTitle": "My Webinar Form",
"formFields": {
"values": [
{
"fieldLabel": "Name"
}
]
},
"options": {
"appendAttribution": false,
"path": "testform",
"ignoreBots": true,
"customCss": ":root {\n\t--font-family: 'Open Sans', sans-serif;\n\t--font-weight-normal: 400;\n\t--font-weight-bold: 600;\n\t--font-size-body: 12px;\n\t--font-size-label: 14px;\n\t--font-size-test-notice: 12px;\n\t--font-size-input: 14px;\n\t--font-size-header: 20px;\n\t--font-size-paragraph: 14px;\n\t--font-size-link: 12px;\n\t--font-size-error: 12px;\n\t--font-size-html-h1: 28px;\n\t--font-size-html-h2: 20px;\n\t--font-size-html-h3: 16px;\n\t--font-size-html-h4: 14px;\n\t--font-size-html-h5: 12px;\n\t--font-size-html-h6: 10px;\n\t--font-size-subheader: 14px;\n\n\t/* Colors */\n\t--color-background: #fbfcfe;\n\t--color-test-notice-text: #e6a23d;\n\t--color-test-notice-bg: #fefaf6;\n\t--color-test-notice-border: #f6dcb7;\n\t--color-card-bg: #ffffff;\n\t--color-card-border: #dbdfe7;\n\t--color-card-shadow: rgba(99, 77, 255, 0.06);\n\t--color-link: #7e8186;\n\t--color-header: #525356;\n\t--color-label: #555555;\n\t--color-input-border: #dbdfe7;\n\t--color-input-text: #71747A;\n\t--color-focus-border: rgb(90, 76, 194);\n\t--color-submit-btn-bg: #ff6d5a;\n\t--color-submit-btn-text: #ffffff;\n\t--color-error: #ea1f30;\n\t--color-required: #ff6d5a;\n\t--color-clear-button-bg: #7e8186;\n\t--color-html-text: #555;\n\t--color-html-link: #ff6d5a;\n\t--color-header-subtext: #7e8186;\n\n\t/* Border Radii */\n\t--border-radius-card: 8px;\n\t--border-radius-input: 6px;\n\t--border-radius-clear-btn: 50%;\n\t--card-border-radius: 8px;\n\n\t/* Spacing */\n\t--padding-container-top: 24px;\n\t--padding-card: 24px;\n\t--padding-test-notice-vertical: 12px;\n\t--padding-test-notice-horizontal: 24px;\n\t--margin-bottom-card: 16px;\n\t--padding-form-input: 12px;\n\t--card-padding: 24px;\n\t--card-margin-bottom: 16px;\n\n\t/* Dimensions */\n\t--container-width: 448px;\n\t--submit-btn-height: 48px;\n\t--checkbox-size: 18px;\n\n\t/* Others */\n\t--box-shadow-card: 0px 4px 16px 0px var(--color-card-shadow);\n\t--opacity-placeholder: 0.5;\n}"
}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
0,
-160
],
"id": "406c577f-4116-42a3-b29c-17ecdb9be4c9",
"name": "On form submission",
"webhookId": "47ae4e13-7134-4f87-a026-42eb647c6c70"
}
],
"pinData": {},
"connections": {
"On form submission": {
"main": [
[]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "e0b487c0-c9ab-4d56-abab-498fb140e730",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "590e953c66f829562cba7c016986c1a38d3c4e5cf4d0ccb973aee93f6cbcd1ce"
},
"id": "oC9QzbKOq9qWXERG",
"tags": []
}
⚠️ WARNING ⚠️ No sensitive data present in this workflow.
Share the output returned by the last node
No output is returned - The execution fails immediately with the Redis key
access error before any nodes can process the data.
Expected output: The form submission should trigger the workflow execution,
which should be queued and processed by worker containers in queue mode.
#[details=“instance information”]
Debug info
core
- n8nVersion: 1.100.1
- platform: docker (self-hosted)
- nodeJsVersion: 22.16.0
- database: postgres
- executionMode: scaling (queue mode)
- concurrency: -1
- license: enterprise (production)
storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: memory
pruning
- enabled: true
- maxAge: 336 hours
- maxCount: 10000 executions
client
- userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36
(khtml, like gecko) chrome/138.0.0.0 safari/537.36 - isTouchDevice: false
Generated at: 2025-07-16T23:27:12.716Z
[/details]
Technical Analysis
Root Cause
The issue is that n8n’s core execution engine has internal code that tries
to access Bull queue Redis keys directly (bull:jobs:1
) without proper
declaration in the Redis script execution context. This affects ALL workflow
executions in queue mode, not just specific node types.
Code Analysis
From the n8n container files analysis:
- Queue Name:
'jobs'
(fromscaling/constants.js
) - Job Type:
'job'
- Bull Key Pattern:
bull:jobs:1
(Job data)
The Form Trigger node appears to have internal code that directly accesses these
Redis keys, which is not allowed in Redis script execution context where all
keys must be declared using the KEYS
array.
Log Sequence
- Webhook received:
Received webhook "POST" for path "testform"
- Execution added:
Execution added {"executionId":"6180"}
- Immediate error: Redis key access error occurs before queuing
Environment Details
- n8n Version: 1.100.1
- Deployment: Kubernetes with Docker containers
- Infrastructure: Self-managed Kubernetes cluster with Traefik ingress
- Queue Mode:
N8N_EXECUTIONS_MODE=queue
- Redis: Redis 7.0+ with Bull queue
- Database: PostgreSQL
- Containers: Main n8n instance + Worker n8n instance (same image)
- Reverse Proxy: Traefik handling SSL termination and routing
- Trigger Node:
n8n-nodes-base.formTrigger
(typeVersion: 2.2)
Problem Description
When running n8n in queue mode (N8N_EXECUTIONS_MODE=queue
), Form Trigger nodes
fail to execute with a Redis script execution error. The error occurs before
the execution gets queued, indicating the issue is in the Form Trigger node’s
internal code.
Error Details
ERR Error running script (call to 27ea40f2e4444b8c0f37ad29529e79e372dbbc82): @user_script:111: script tried accessing undeclared key, key: bull:jobs:1
Log Sequence
- Webhook received:
Received webhook "POST" for path "testform"
- Execution added:
Execution added {"executionId":"6180"}
- Immediate error: Redis key access error occurs before queuing
Root Cause Analysis
The issue is that the Form Trigger node (n8n-nodes-base.formTrigger
) has
internal code that tries to access Bull queue Redis keys directly
(bull:jobs:1
) without proper declaration in the Redis script execution
context.
Code Analysis
From the n8n container files analysis:
- Queue Name:
'jobs'
(fromscaling/constants.js
) - Job Type:
'job'
- Bull Key Pattern:
bull:jobs:1
(Job data)
The Form Trigger node appears to have internal code that directly accesses these
Redis keys, which is not allowed in Redis script execution context where all
keys must be declared using the KEYS
array.
Workflow Configuration
The failing workflow is a simple form submission test:
Environment Configuration
Queue Mode Settings
N8N_EXECUTIONS_MODE=queue
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
N8N_DISABLE_PRODUCTION_MAIN_PROCESS=false
Redis Configuration
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
Impact
- ALL workflows are unusable in queue mode
- Any workflow execution fails immediately
- No execution reaches the worker containers
- Queue mode is completely broken for production use
- Manual executions, webhooks, scheduled triggers all fail
Workarounds
1. Switch to Regular Mode (Immediate Fix)
# Change execution mode to regular
N8N_EXECUTIONS_MODE=regular
Note: This disables queue mode entirely, losing the benefits of distributed
processing and scalability.
2. Use Single-Container Deployment
- Deploy n8n without worker containers
- Run everything in the main container
- Accept performance limitations
3. Wait for Bug Fix
- Queue mode is currently unusable in production
- Monitor n8n releases for a fix
- Consider downgrading to a version where queue mode works
Technical Details
Redis Script Execution Context
When Redis executes scripts (like Lua scripts), it requires all keys to be
declared using the KEYS
array. The error suggests the Form Trigger node is
trying to access bull:jobs:1
without proper declaration.
Bull Queue Key Patterns
Bull uses specific Redis key patterns:
bull:jobs:1
- Job databull:jobs:active
- Active jobsbull:jobs:waiting
- Waiting jobsbull:jobs:completed
- Completed jobs
n8n Queue Implementation
From the code analysis:
- Scaling Service: Manages Bull queue setup
- Redis Client Service: Handles Redis connections
- Workflow Runner: Determines execution mode
Reproduction Steps
- Deploy n8n in queue mode with Redis
- Create a workflow with a Form Trigger node
- Activate the workflow
- Submit a form to the webhook endpoint
- Observe the Redis key access error
Expected Behavior
All workflows should work in queue mode with executions properly queued and
processed by worker containers. Queue mode should provide distributed processing
and scalability benefits.
Actual Behavior
All workflows fail immediately with Redis script execution errors,
preventing any execution from reaching the queue. Queue mode is completely
broken.
Files Analyzed
The following n8n container files were analyzed to understand the issue:
dist/scaling/scaling.service.js
- Queue managementdist/services/redis-client.service.js
- Redis connectionsdist/workflow-runner.js
- Execution handlingdist/scaling/constants.js
- Queue configurationdist/config/schema.js
- Configuration schema
Community Impact
This bug affects users who:
- Run n8n in queue mode for scalability
- Use Form Trigger nodes for data collection
- Deploy n8n in production environments
Request for Fix
This appears to be a critical bug in n8n’s core execution engine when
running in queue mode. The execution engine should either:
- Not access Redis keys directly
- Properly declare keys in Redis script context
- Use n8n’s queue APIs instead of direct Redis access
This is a production-blocking issue that affects all users trying to use
queue mode for scalability.
Additional Context
This issue was discovered while troubleshooting a production n8n deployment
running in queue mode with Redis and PostgreSQL. The deployment uses:
Infrastructure
- Kubernetes Cluster: Self-managed Kubernetes cluster
- Reverse Proxy: Traefik as ingress controller
- Load Balancer: Traefik handles SSL termination and routing
n8n Deployment
- Main Container: n8n main instance handling webhooks and UI
- Worker Container: Same n8n image running as worker for queue processing
- Container Orchestration: Kubernetes manages both containers
- Service Discovery: Kubernetes services for internal communication
Architecture
Internet → Traefik → n8n-main (webhooks/UI) → Redis Queue → n8n-worker (executions)
The same Docker image is used for both main and worker containers, with
different startup commands and environment variables to differentiate their
roles.
Report Date: July 16, 2025
n8n Version: 1.100.1
Environment: Kubernetes + Traefik + Docker + Redis + PostgreSQL
Queue Mode: Enabled
Deployment: Main + Worker containers (same image)
ENVIRONMENT VARIABLES PASSED
# Container Names Configuration
CONTAINER_N8N_MAIN=n8n-main
CONTAINER_N8N_WORKER=n8n-worker
CONTAINER_POSTGRES=postgres
CONTAINER_REDIS=redis
PROXY_NAME=traefik
# Local development environment configuration
TIMEZONE=America/Chicago
URL=https://flow.domain.ai
CUSTOM_DOMAIN=flow.domain.ai
# Cert-Manager Configuration - CERT_ISSUER and CERT_EMAIL are now defined at infrastructure level
# NodePort Configuration (Local Development)
NODEPORT_HTTP=30080
NODEPORT_HTTPS=30443
NODEPORT_DASHBOARD=30808
# Database Configuration
DB_POSTGRESDB_HOST=${CONTAINER_POSTGRES}
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=hmadmin
DB_POSTGRESDB_PASSWORD=jdkssu_8932o@!
# Redis Configuration
DB_REDIS_HOST=${CONTAINER_REDIS}
DB_REDIS_PORT=6379
DB_REDIS_PASSWORD=MyRedisPassword
# N8N Configuration
WEBHOOK_URL=https://flow.domain.ai
N8N_EDITOR_BASE_URL=https://flow.domain.ai
N8N_SECURE_COOKIE=true
N8N_PROTOCOL=http
N8N_HOST=0.0.0.0
N8N_PORT=5678
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=**REDACTED**
N8N_LOG_LEVEL=debug
N8N_DIAGNOSTICS_ENABLED=true
N8N_ENCRYPTION_KEY=**REDACTED**
N8N_LICENSE_ACTIVATION_KEY=**REDACTED**
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
# Scaling Configuration
N8N_TARGET_INITIAL_REPLICA_COUNT=1
N8N_RUNNERS_ENABLED=true
N8N_RUNNERS_MODE=external
N8N_RUNNERS_MAX_CONCURRENCY=25
#MultiMain Processes & MultiWorker Processes
N8N_EXECUTIONS_MODE=queue #queue | regular
N8N_MULTI_MAIN_SETUP_ENABLED=false
N8N_DISABLE_PRODUCTION_MAIN_PROCESS=false
N8N_WORKER_CONCURRENCY=35
N8N_QUEUE_BULL_REDIS_DB=0
N8N_WORKER_REPLICA_COUNT=1
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true #Flipping This to TRUE causes manual executions in production UI to fail