I am experiencing an issue with the Function/Code node in my workflow. Even with the simplest code, the node gets stuck in execution indefinitely. The execution spinner never stops, and no output is returned.
There is no explicit error message. The node simply continues to execute without completing.
I am using a minimal workflow that includes a Manual Trigger node connected to a Function/Code node containing the following code:
return [
{ json: { name: "anja" } }
];
When I execute this workflow, the Function/Code node never finishes, causing the entire workflow to hang.
No output is returned, as the node remains stuck in execution.
Hi, yes I have tried with both and it still fails. The interesting part is my code nodes for workflows that have been running for months now started doing the same thing but they haven’t been touched
Oddly, if I copy your node into my n8n workflow and run it, it does work. However if I add a code node and put the javascript you have in your code node into my, it doesn’t run. Maybe an issue with a code node version?
Edit: Confirmed that copying and pasting @Franz 's code node into my workflows seems to fix my issue, I’ve got a few dozen so may take some time to get my workflows to work but at least it does work now
I had issues with @Franz nodes all of a sudden, but I was able to get the old function node and function item node to work. Here they are if anyone else needs it:
Function node is deprecated. It does not use Task Runners. You need to make sure the code in Code node is up to date with references, Current node input | n8n Docs.
This actually led me down the path of what the issue was. There was an external module (papaparse) that was failing to load, causing the task runner to crash and thereby none of the code nodes to work. Removing that from my env variables fixed it