Starting a few days ago, I started facing a really strange issue. All Code nodes are processing forever irrespective how simple or complex the Javascript logic in them is.
For example, if I add a Code node with the default code to a new workflow and I simply execute it as a single step it runs forever, unless I terminate it.
Today my N8N as also rebooted one time due to an issue I was facing and I was hoping that the restart would fix the code block issue. But it didn’t.
At the moment all my workflows that have a Code block never finish execution. I would really appreciate some help on this.
What is the error message (if any)?
No error message, just the Code node just processes forever.
Please share your workflow
Share the output returned by the last node
I am expecting that the Code node executes the code in it in a few seconds or less and returns the output.
Information on your n8n setup
n8n version:: 1.72.1
Database (default: SQLite):: Not sure, default db that comes with the cloud hosted N8N
n8n EXECUTIONS_PROCESS setting (default: own, main):: Default of the N8N cloud hosted Starter plan
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
There is nothing in your code that could have stalled its execution. Is that the actual workflow or it is more complex than that?
In case anyone is facing this issue. Someone from support replied and disabled a new feature introduced in the Code node because I was running an older N8N version. Then the issue got fixed. Thank you
Hi!
Can you share how to disable this feature? I’m facing the same problem, I updated n8n to the last version but it didn’t fix the issue!
Code node does not finish executing in any case
We can temporary deactivate Task Runner on a specific n8n Cloud workspace (if that is where you have your n8n instance). However, that is currently not the best approach. The code rather needs to be reviewed and adjusted. We had a few bugs at the beginning but by now they should be resolved and if the Code node still stalls than there is something in the code that needs updating.
We are self-hosted, though I thought we’ve been using the task runner for awhile. I added more info in this thread: Help! Code node stopped working! - #5 by jhambach but my only fix was to use the old function/functionitem nodes. Is there something I could see via logs as to why that’s happening? I tried using the two nodes that @Franz added in a workflow and this is what they do:
Video: Code Node Issue