CODE nodes are failing with "Task request timed out after 600 seconds" error

Task request timed out after 600 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.

Describe the problem/error/question

We are facing an issue where CODE nodes are failing with the error:
Task request timed out after 600 seconds
This seems to be happening during workflow execution
Environment
Setup: Separate container for task runner

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.123.20 (Self Hosted)
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

@CHARAN_TEJA n8n enables external task runners by default on v2(and perhaps latest versions of v1). If you don’t have any runner instances at the moment, you can switch to internal mode by setting the following environment variable:

N8N_RUNNERS_MODE=internal

This isn’t recommended for production, but it will solve this issue. If you want to switch to external mode, refer to the official documentation on setting up task runners.

Edit: Missed the setup line, see @achamm’s reply instead.

2 Likes

Hey since youre running the task runner as a separate container, this is almost always a networking issue. Make sure N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0 is set on your n8n container because by default it only listens on localhost which means the runner container cant reach it. Also double check that N8N_RUNNERS_TASK_BROKER_URI on your runner points to the right docker service name like http://n8n:5679 and that your runner image version matches your n8n version exactly.

had to debug this exact issue a few weeks ago. the usual suspects: docker internal hostname vs localhost (task runner can’t reach the main container if you’re using localhost), task-runner json config with wrong command/args, or the container just running out of memory and getting OOM-killed silently. check docker logs for the task runner container first — if it’s restarting that’s your answer. also which n8n version are you on? there were some task runner fixes in recent releases.

Hello,

I checked, the config looks good.

  • No OOM
  • The custom task-runner json works locally.

My findings are the following:

  • Javascript code node → No problem
  • Python Native code → Timeout after some time. It works for 1-3 hours and then it stopped.

Logs are not really saying something helpful.

I’m thinking to disable the external task runner.