Code nodes no longer working - across all workflows

Hi,

We have been running a lot of workflows in n8n without any issues until ~2 weeks ago. We love the tool!

2 weeks ago we started experiencing connectivity issues, and last week all of the CODE NODES, across ALL workflows stopped working. Workflows get stuck in the code nodes, and we are not able to use any of our implementations.

Can someone from the n8n team help us look into this? I imagine it has to do with a bug in the new version, but I do not have enough technical knowledge to debug it.

Thanks in advance!

Information on your n8n setup

  • n8n version: 1.103.2
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud

Hey @maia.grauer hope all is well.

Disclaimer: I am a community member, not an n8n core team member.

Could you please provide more details as to what your code nodes do, example of such code nodes, preferably steps to reproduce. Were you able to boil it down to a specific action in the code node that causes the error?
Whether it is a bug in n8n or in the code or even in general approach to building a workflow is something that can only be determined when enough information is shared.

Thank you very much for the help @jabbson.

We have a lot of code nodes, and none are working.

For example, this is a code node that received 4k items, and before was running fine and fast, and now gets stuck. I am not able to see where inside the code node it is happening:

return items.filter(item => {
const text = item.json.DATA_Ingredients; // Change ā€˜text’ to the actual field name
if (typeof text === ā€˜string’) {
return text.length < 300;
}
return false;
});

That said, it is happening across all code nodes, across all workflows. So it might be something related to the version of n8n we are using.

Any suggestions on what other specific information would be helpful to understand what is happening?

Thank you so much!
Maia

Hey Maia, nice to meet you!

If I were you, what I would do I’d explore the idea, that the issue could also be related to the data which is processed by the node. Did its content change significantly since the ā€œgoodā€ times? Is it always a lot of data? Was the data smaller before (when the code node wasn’t giving you any head ache)? Could this be related to the resource bottlenecks of the instance running n8n? See some resource limitations here.

In order to understand whether the issue could be related to the environment limits, you could:

  • try to run against a smaller datasets, to see if that eliminates the problem (the issue then could be with the amount of data). See other approaches on the base linked above.
  • attempt to break down the code node into multiple code nodes to pin point the issue with better precision

Regarding the code above. If this is the only content of the code node, you could easily change it to the filter node.

Something like this?

Thank you again @jabbson !

We have tried with less data, and every single node code gets stuck.

Before we had the same exact data types and quantity, and it was running fine.

For example, I just tried again running the code I shares above, passing only 6 items, and it gets stuck indefinitely.

Thanks for the suggestion on how to replace this specific code node. I will do so, definitely. But we have 20+ workflows with code nodes, which in some cases are quote complex, and I want to avoid having to re do all workflows :frowning:

I see, thank you for explanation and additional context.

So, if you tried to run the following workflow:

Would it fail for you?

I tried running the workflow you provided. And it does not run. It gets stuck on the first code node :frowning:

I am sharing the image below just fo reference. I stopped it after a few minutes of running.

Hmm, interesting.
Do you have other currently executing workflows?

None. Just that one that you shared

Have you tried upgrading the instance from 103 to 105?

I did manage to find other topics with a similar issue:

Thanks for sharing! Seems like someone else is having the same issue.

I have not updated to the 105 version, as it is not the recommended one, and I am worried other stuff will break.

105 is the latest stable. I am running it, don’t have issues.
Also, things are pretty broken already as is, right? :slight_smile:

1 Like

I just updated to version 105, and my workspace has been offline for 3 hrs :frowning:

Can someone from the n8n team help us with this?

Thanks

I am having the same issue. Since updating to the latest a few weeks ago, a code node with JavaScript that returns a simple ā€œhello worldā€ will run and hang indefinitely. If I change the node to Python (Beta) and convert the code to Python, the same simple return of ā€œhello worldā€ completes successfully.

I have redeployed the latest version of n8n as of today and still receive the same issue. It also occurs on all workflows, not just a specific one. I am in the process of converting my JavaScript code to Python however I feel like an update to n8n broke the environment and I would like to know more. Any ideas on how to do a deeper debug of this issue?

n8n version: 1.112.5 (Self Hosted)

Code node version 2 (Latest)

Hi all,

Any progress on this issue? I’m experiencing the exact same problem and I don’t have any starting points to conduct any serious diagnosing.

I might add that when I run a code node with JS, i can cancel it. Afterwards (without restarting containers) the code node with python doesn’t run either.

Thanks already.
Merijn