n8n - 💡(How to fix) Fix Code node times out in production execution (Webhook/Timer/Form) but works during manual testing in v2

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

n8n worker server listening on port 5678 Worker started execution 2 (job 1) Task request timed out Error: Task request timed out at ErrorReporter.wrap (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:308:37) at ErrorReporter.error (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:294:25) at LocalTaskRequester.requestExpired (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:309:22) at LocalTaskRequester.onMessage (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:272:10) at TaskBroker.handleRequestTimeout (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:120:50) at Timeout.<anonymous> (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:107:9) at listOnTimeout (node:internal/timers:605:17) at processTimers (node:internal/timers:541:7)

Task request timed out after 60 seconds Worker finished execution 2 (job 1)

Code Example

version: "3.8"
   
   volumes:
     db_storage:
     n8n_storage:
     redis_storage:
   
   x-shared: &shared
     restart: always
     image: docker.n8n.io/n8nio/n8n
     environment:
       - DB_TYPE=postgresdb
       - DB_POSTGRESDB_HOST=postgres
       - DB_POSTGRESDB_PORT=5432
       - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
       - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
       - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
       - EXECUTIONS_MODE=queue
       - QUEUE_BULL_REDIS_HOST=redis
       - QUEUE_HEALTH_CHECK_ACTIVE=true
       - QUEUE_BULL_REDIS_PORT=6379
       - QUEUE_BULL_REDIS_PASSWORD=g9re89gr
       - N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
       - GENERIC_TIMEZONE=Asia/Shanghai
       - TZ=Asia/Shanghai
       - N8N_SECURE_COOKIE=false
       - N8N_RUNNERS_ENABLED=true
       - N8N_RUNNERS_MODE=external
       - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
       - N8N_RUNNERS_BROKER_PORT=5679
       - N8N_RUNNERS_MAX_CONCURRENCY=20
       - N8N_RUNNERS_TASK_TIMEOUT=600
       - N8N_RUNNERS_AUTH_TOKEN=g9re89gr
       - N8N_RUNNERS_EXTERNAL_ALLOW=*
       - N8N_NATIVE_PYTHON_RUNNER=true
       - N8N_DEFAULT_LOCALE=zh-CN
       - WEBHOOK_URL=http://localhost:5678/
       - N8N_PROXY_HOPS=1
       - N8N_DIAGNOSTICS_ENABLED=false
       - N8N_VERSION_NOTIFICATIONS_ENABLED=false
       - N8N_TEMPLATES_ENABLED=false
     links:
       - postgres
       - redis
     volumes:
       - n8n_storage:/home/node/.n8n
     depends_on:
       redis:
         condition: service_healthy
       postgres:
         condition: service_healthy
   
   services:
     postgres:
       image: postgres:16
       restart: always
       environment:
         - POSTGRES_USER
         - POSTGRES_PASSWORD
         - POSTGRES_DB
         - POSTGRES_NON_ROOT_USER
         - POSTGRES_NON_ROOT_PASSWORD
       volumes:
         - db_storage:/var/lib/postgresql/data
         - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
       healthcheck:
         test:
           [
             "CMD-SHELL",
             "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}",
           ]
         interval: 5s
         timeout: 5s
         retries: 10
   
     redis:
       image: redis:6-alpine
       restart: always
       volumes:
         - redis_storage:/data
       healthcheck:
         test: ["CMD", "redis-cli", "ping"]
         interval: 5s
         timeout: 5s
         retries: 10
       command: redis-server --requirepass g9re89gr
   
     n8n:
       <<: *shared
       container_name: n8n-main
       ports:
         - 5678:5678
   
     n8n-worker:
       <<: *shared
       command: worker
       depends_on:
         - n8n
   
     task-runners:
       build:
         context: .
         dockerfile: Dockerfile.runners
       image: n8nio/runners:latest
       container_name: n8n-runners
       restart: unless-stopped
       environment:
         - N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
         - N8N_RUNNERS_AUTH_TOKEN=g9re89gr
         - N8N_RUNNERS_MAX_CONCURRENCY=20
         - N8N_RUNNERS_EXTERNAL_ALLOW=*
         - N8N_RUNNERS_TASK_TIMEOUT=600
         - GENERIC_TIMEZONE=Asia/Shanghai
         - TZ=Asia/Shanghai
       depends_on:
         - n8n

---

{
     "name": "My workflow",
     "nodes": [
       {
         "parameters": {
           "formTitle": "Bug Report Form",
           "responseMode": "lastNode",
           "options": {}
         },
         "type": "n8n-nodes-base.formTrigger",
         "typeVersion": 2.5,
         "position": [
           0,
           0
         ],
         "id": "5ccc2207-4069-4660-abc6-6a1e0f846829",
         "name": "On form submission",
         "webhookId": "49e21462-2522-4541-bcc1-f9509c4efa3a"
       },
       {
         "parameters": {
           "language": "pythonNative",
           "pythonCode": "return {\n  'foo': 'bar'\n}"
         },
         "type": "n8n-nodes-base.code",
         "typeVersion": 2,
         "position": [
           208,
           0
         ],
         "id": "8e2bf386-7c03-4d49-9c0c-d4f59878a7f1",
         "name": "Code in Python"
       }
     ],
     "pinData": {},
     "connections": {
       "On form submission": {
         "main": [
           [
             {
               "node": "Code in Python",
               "type": "main",
               "index": 0
             }
           ]
         ]
       }
     },
     "active": true,
     "settings": {
       "executionOrder": "v1",
       "binaryMode": "separate",
       "availableInMCP": false
     },
     "versionId": "007c0605-565b-4fcc-be1f-8b213b2e45e6",
     "meta": {
       "instanceId": "2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6"
     },
     "id": "D58W8IzrZeL71Cme",
     "tags": []
   }

---

n8n worker server listening on port 5678
Worker started execution 2 (job 1)
Task request timed out
Error: Task request timed out
    at ErrorReporter.wrap (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:308:37)
    at ErrorReporter.error (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:294:25)
    at LocalTaskRequester.requestExpired (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:309:22)
    at LocalTaskRequester.onMessage (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:272:10)
    at TaskBroker.handleRequestTimeout (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:120:50)
    at Timeout.<anonymous> (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:107:9)
    at listOnTimeout (node:internal/timers:605:17)
    at processTimers (node:internal/timers:541:7)

Task request timed out after 60 seconds
Worker finished execution 2 (job 1)
RAW_BUFFERClick to expand / collapse

Bug Description

In n8n v2 (which utilizes the task runner to execute Code nodes), workflows containing a Code node run normally during manual debugging. However, when the workflow is published and triggered in a production environment (e.g., via Webhook, Schedule/Timer, or Form trigger), the Code node unexpectedly times out.

This behavior appears to be related to issue #23553.

To Reproduce

  1. Deploy and run n8n using the docker-compose.yml configuration provided below.

    version: "3.8"
    
    volumes:
      db_storage:
      n8n_storage:
      redis_storage:
    
    x-shared: &shared
      restart: always
      image: docker.n8n.io/n8nio/n8n
      environment:
        - DB_TYPE=postgresdb
        - DB_POSTGRESDB_HOST=postgres
        - DB_POSTGRESDB_PORT=5432
        - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
        - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
        - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
        - EXECUTIONS_MODE=queue
        - QUEUE_BULL_REDIS_HOST=redis
        - QUEUE_HEALTH_CHECK_ACTIVE=true
        - QUEUE_BULL_REDIS_PORT=6379
        - QUEUE_BULL_REDIS_PASSWORD=g9re89gr
        - N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
        - GENERIC_TIMEZONE=Asia/Shanghai
        - TZ=Asia/Shanghai
        - N8N_SECURE_COOKIE=false
        - N8N_RUNNERS_ENABLED=true
        - N8N_RUNNERS_MODE=external
        - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
        - N8N_RUNNERS_BROKER_PORT=5679
        - N8N_RUNNERS_MAX_CONCURRENCY=20
        - N8N_RUNNERS_TASK_TIMEOUT=600
        - N8N_RUNNERS_AUTH_TOKEN=g9re89gr
        - N8N_RUNNERS_EXTERNAL_ALLOW=*
        - N8N_NATIVE_PYTHON_RUNNER=true
        - N8N_DEFAULT_LOCALE=zh-CN
        - WEBHOOK_URL=http://localhost:5678/
        - N8N_PROXY_HOPS=1
        - N8N_DIAGNOSTICS_ENABLED=false
        - N8N_VERSION_NOTIFICATIONS_ENABLED=false
        - N8N_TEMPLATES_ENABLED=false
      links:
        - postgres
        - redis
      volumes:
        - n8n_storage:/home/node/.n8n
      depends_on:
        redis:
          condition: service_healthy
        postgres:
          condition: service_healthy
    
    services:
      postgres:
        image: postgres:16
        restart: always
        environment:
          - POSTGRES_USER
          - POSTGRES_PASSWORD
          - POSTGRES_DB
          - POSTGRES_NON_ROOT_USER
          - POSTGRES_NON_ROOT_PASSWORD
        volumes:
          - db_storage:/var/lib/postgresql/data
          - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
        healthcheck:
          test:
            [
              "CMD-SHELL",
              "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}",
            ]
          interval: 5s
          timeout: 5s
          retries: 10
    
      redis:
        image: redis:6-alpine
        restart: always
        volumes:
          - redis_storage:/data
        healthcheck:
          test: ["CMD", "redis-cli", "ping"]
          interval: 5s
          timeout: 5s
          retries: 10
        command: redis-server --requirepass g9re89gr
    
      n8n:
        <<: *shared
        container_name: n8n-main
        ports:
          - 5678:5678
    
      n8n-worker:
        <<: *shared
        command: worker
        depends_on:
          - n8n
    
      task-runners:
        build:
          context: .
          dockerfile: Dockerfile.runners
        image: n8nio/runners:latest
        container_name: n8n-runners
        restart: unless-stopped
        environment:
          - N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
          - N8N_RUNNERS_AUTH_TOKEN=g9re89gr
          - N8N_RUNNERS_MAX_CONCURRENCY=20
          - N8N_RUNNERS_EXTERNAL_ALLOW=*
          - N8N_RUNNERS_TASK_TIMEOUT=600
          - GENERIC_TIMEZONE=Asia/Shanghai
          - TZ=Asia/Shanghai
        depends_on:
          - n8n
  2. Import the sample workflow.

    {
      "name": "My workflow",
      "nodes": [
        {
          "parameters": {
            "formTitle": "Bug Report Form",
            "responseMode": "lastNode",
            "options": {}
          },
          "type": "n8n-nodes-base.formTrigger",
          "typeVersion": 2.5,
          "position": [
            0,
            0
          ],
          "id": "5ccc2207-4069-4660-abc6-6a1e0f846829",
          "name": "On form submission",
          "webhookId": "49e21462-2522-4541-bcc1-f9509c4efa3a"
        },
        {
          "parameters": {
            "language": "pythonNative",
            "pythonCode": "return {\n  'foo': 'bar'\n}"
          },
          "type": "n8n-nodes-base.code",
          "typeVersion": 2,
          "position": [
            208,
            0
          ],
          "id": "8e2bf386-7c03-4d49-9c0c-d4f59878a7f1",
          "name": "Code in Python"
        }
      ],
      "pinData": {},
      "connections": {
        "On form submission": {
          "main": [
            [
              {
                "node": "Code in Python",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      },
      "active": true,
      "settings": {
        "executionOrder": "v1",
        "binaryMode": "separate",
        "availableInMCP": false
      },
      "versionId": "007c0605-565b-4fcc-be1f-8b213b2e45e6",
      "meta": {
        "instanceId": "2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6"
      },
      "id": "D58W8IzrZeL71Cme",
      "tags": []
    }
  3. Trigger the workflow using the Form Trigger node:

    • Test Environment: Submitting via the Test URL runs successfully.

    • Production Environment: Submitting via the Production URL results in a timeout at the Code node.

<img width="775" height="329" alt="Image" src="https://github.com/user-attachments/assets/7b36d3de-4e51-4c4a-970b-ea52684c8697" />

Expected behavior

The Code node should execute successfully without timing out, regardless of whether the workflow is being tested manually in the UI or running in a published/production state (triggered via Webhook, Timer, or Form).

Debug Info

Debug info

core

  • n8nVersion: 2.10.3
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.13.1
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (single-main)
  • concurrency: -1
  • license: community
  • consumerId: unknown

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: database

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/148.0.0.0 safari/537.36
  • isTouchDevice: false

security

  • secureCookie: false

Generated at: 2026-05-29T02:30:02.843Z


The n8n-worker container report an error, other containers work well without any error log:

n8n worker server listening on port 5678
Worker started execution 2 (job 1)
Task request timed out
Error: Task request timed out
    at ErrorReporter.wrap (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:308:37)
    at ErrorReporter.error (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/errors/error-reporter.ts:294:25)
    at LocalTaskRequester.requestExpired (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:309:22)
    at LocalTaskRequester.onMessage (/usr/local/lib/node_modules/n8n/src/task-runners/task-managers/task-requester.ts:272:10)
    at TaskBroker.handleRequestTimeout (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:120:50)
    at Timeout.<anonymous> (/usr/local/lib/node_modules/n8n/src/task-runners/task-broker/task-broker.service.ts:107:9)
    at listOnTimeout (node:internal/timers:605:17)
    at processTimers (node:internal/timers:541:7)

Task request timed out after 60 seconds
Worker finished execution 2 (job 1)

Operating System

Tested on macOS Sequoia 15.7.4 and Ubuntu 24.04

n8n Version

Tested on versions 2.10.3 through 2.22.5 (issue is present in all tested versions)

Node.js Version

24.13.1

Database

PostgreSQL

Execution mode

queue

Hosting

self hosted

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Code node should execute successfully without timing out, regardless of whether the workflow is being tested manually in the UI or running in a published/production state (triggered via Webhook, Timer, or Form).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix Code node times out in production execution (Webhook/Timer/Form) but works during manual testing in v2