Under load execution fails with fatal error

Please my workflow uses a large function node to transforma high volume item stream, but then it fails under load execution with fatal error: reached heap limit allocation failed , Javascript heap out of memory, but then function works perfectly on isolation with a single test execution

1 Like

ook the root cause is that The Function node’s default “Run Once for All Items” mode is the culprit. This mode collects all items from the input stream into a single, massive array before passing it to your function. This monolithic array allocation exceeds Node.js’s default heap size (1.5GB), causing the process to abort.

1 Like

You should change the Function node’s execution mode to “Run Once for Each Item”. This processes items individually, streaming them through your function without aggregating them in memory. This eliminates the memory overhead at the cost of potentially more function invocations.

you should also share your screen to make it easier

2 Likes

Oh now I get sir thank you this actually helped !

1 Like

Yeah you can also use the link below for reference

2 Likes