[v1.119.0] Python Native Task Runner – Failed to read result from child process

Hello,

I am using the Task Runners and a Code Node – Python (Native) (Beta) in a workflow,

Everything was working fine until I upgraded to n8n v1.119.0

After the upgrade, I started getting the following error when running Python code:

Error: Failed to read result from child process at throwExecutionError (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Code/throw-execution-error.ts:11:9) at PythonTaskRunnerSandbox.runUsingIncomingItems (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Code/PythonTaskRunnerSandbox.ts:56:30) at processTicksAndRejections (node:internal/process/task_queues:105:5) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/Code/Code.node.ts:173:12) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1708:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2324:11

Some additional context:

  • The same workflow worked correctly before v1.119.0.
  • I haven’t changed the Python code or the input data.
  • I suspect the issue is related to how the Python code returns data back to n8n.

Could you please advise if there were changes in v1.119.0 related to the Python native task runner that could cause this?
I know a workaround that fixes it, but I wanted to report it in case this is a bug or intentional behavior idk.

Thanks

Hi mohamed3nan,

In v1.119.0, there’s a breaking change related to the new native Python task runner (beta). The task runner now expects Python code to return data in a specific format so the child process can serialize it properly.

To fix this, make sure your Python code returns a list of dicts with ‘json’ keys. For example, instead of: return my_data

You should use: return [{‘json’: my_data}] ( For a single item)

Or for multiple items: return [{‘json’: item} for item in my_items]

This change was documented in the v1.113+ release notes when n8n replaced Pyodide with native Python task runners. All Code nodes using Python need to be updated to follow the new return format.

Hi @not0lucky

I’m aware of the fix already, but these are not working for your information..

I couldn’t find a documentation link explaining this behavior.
Could you share where you found this information?

1 Like