Still doesn’t seem to work…
Please can you share your workflow in a code block. Im suspecting you have not followed the guide on the breaking changes in python
Thanks Wouter, I’m using n8n v2.2.3 with Ubuntu. I used your config, but unfortunately both JavaScript and Python code nodes are timing out.
So this looks more like a container/env config error. Both the n8n-main and n8n-runners containers are up:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bae921856c14db8bce853d7e1cd7c82859b447f4e4cdb8359f87e64905270622 n8nio/runners:latest "tini -- /usr/local/bin/task-runner-launcher javascript python" 10 minutes ago Up 10 minutes 5680/tcp n8n-runners
078b7edcd2c51533ade72f6ce6fe04335fb60eab7c223ebcd3dfc2979871c3f0 n8nio/n8n:latest "tini -- /docker-entrypoint.sh" 15 minutes ago Up 15 minutes 0.0.0.0:5678->5678/tcp, [::]:5678->5678/tcp n8n-main
The n8n-main container is on ports "5678:5678". The runners broker listen address is 0.0.0.0, and the runner task broker URI is http://n8n-main:5679. I also added the volume for the runner container.
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n-main
volumes:
- ./n8n_data:/home/node/.n8n
ports:
- "5678:5678"
environment:
# Task runner configuration for v2 (external mode)
- N8N_RUNNERS_ENABLED=true
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
- N8N_RUNNERS_AUTH_TOKEN=your-secret-here
task-runners:
image: n8nio/runners:latest
container_name: n8n-runners
volumes:
- ./n8n_data:/home/node/.n8n
environment:
# Task runner configuration
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
- N8N_RUNNERS_AUTH_TOKEN=your-secret-here
# Enable Python and JavaScript support
- N8N_RUNNERS_ENABLED_TASK_TYPES=javascript,python
# Auto shutdown after 15 seconds of inactivity
- N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT=15
depends_on:
- n8n
Are there any network/VPN/container related issues that could prevent access to the runner container?
My VPN was just preventing hostname resolution, which caused the task runners to be stuck waiting. I specified the proxy explicitly and now both python and javascript work well.
services:
n8n-main:
image: n8nio/n8n:latest
container_name: n8n-main
networks:
- n8n-network
volumes:
- ./n8n_data:/home/node/.n8n
ports:
- "5678:5678"
environment:
# Task runner configuration for v2 (external mode)
- N8N_RUNNERS_ENABLED=true
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
- N8N_RUNNERS_AUTH_TOKEN=your-secret-here
# Proxy configuration for external traffic
- HTTP_PROXY=http://host.docker.internal:17890
- HTTPS_PROXY=http://host.docker.internal:17890
- NO_PROXY=localhost,127.0.0.1,n8n-main,task-runners
extra_hosts:
- "host.docker.internal:host-gateway"
task-runners:
image: n8nio/runners:latest
container_name: n8n-runners
networks:
- n8n-network
volumes:
- ./n8n_data:/home/node/.n8n
environment:
# Task runner configuration
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
- N8N_RUNNERS_AUTH_TOKEN=your-secret-here
# Enable Python and JavaScript support
- N8N_RUNNERS_ENABLED_TASK_TYPES=javascript,python
# Auto shutdown after 15 seconds of inactivity
- N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT=15
# Proxy configuration for external traffic
- HTTP_PROXY=http://host.docker.internal:17890
- HTTPS_PROXY=http://host.docker.internal:17890
- NO_PROXY=localhost,127.0.0.1,n8n-main,task-runners
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- n8n-main
networks:
n8n-network:
driver: bridge
I was able to resolve it for myself as well. I added both the main and runner to the same n8n network.
compose.yml below:
services:
n8n-main:
image: n8nio/n8n:latest
container_name: n8n-main
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=<redacted>
- N8N_PORT=5678
- N8N_PROTOCOL=https
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=<redacted>
- N8N_BASIC_AUTH_PASSWORD=<redacted>
- NODE_ENV=production
- WEBHOOK_URL=https://<redacted>
- N8N_PROXY_HOPS=1
- N8N_RESTRICT_FILE_ACCESS_TO=/files
- N8N_PAYLOAD_SIZE_MAX=1024
- N8N_RUNNERS_ENABLED=true
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
- N8N_RUNNERS_AUTH_TOKEN=<redacted>
volumes:
- ~/.n8n:/home/node/.n8n
- ~/n8n/files:/files
networks:
- n8n_network
task-runners:
image: n8nio/runners:latest
container_name: n8n-runners
restart: always
environment:
- N8N_RUNNERS_MODE=external
- N8N_RUNNERS_AUTH_TOKEN=<redacted>
- N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
- N8N_RUNNERS_ENABLED_TASK_TYPES=javascript,python
- N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT=15
volumes:
- ~/.n8n:/home/node/.n8n
depends_on:
- n8n-main
networks:
- n8n_network
networks:
n8n_network:
driver: bridge
OP, try adding this inside your task-runners service.
networks:
- n8n_network
Just wanted to confirm I had this same issue On Elastio in a CI/CD pipeline.
Changed Docker compose from n8n: to n8n-main
And
N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
Started working immediately on a javascript node that was failing and timing out.
it was working but now i got this when executing js node
Task request timed out after 60 seconds Your Code node task was not matched to a runner within the timeout period. This indicates that the task runner is currently down, or not ready, or at capacity, so it cannot service your task. If you are repeatedly executing Code nodes with long-running tasks across your instance, please space them apart to give the runner time to catch up. If this does not describe your use case, please open a GitHub issue or reach out to support. If needed, you can increase the timeout using the N8N_RUNNERS_TASK_REQUEST_TIMEOUT environment variable.



