An inherited workflow uses the legacy 'code mode' JavaScript loop (last seen ~2024), and its loop is now returning empty arrays/null — the question is whether code mode in loops was fully deprecated 'this week'.
AI Response
The legacy 'code mode' loop has not been deprecated. Retool staff have confirmed that legacy loops remain supported until the new Loop block reaches feature parity, and that existing legacy loops should continue to run — with no near-term deprecation on the workflows roadmap as of early 2026. The current Loop block documentation likewise still supports iterating over an array using value and index. Empty/null output is therefore far more likely a data issue — the loop input evaluating to an empty array or a non-iterable value — than a removal of the feature, so it's worth inspecting the exact input the loop receives at runtime and confirming it resolves to a populated array.
Sources
Loop script in workflow has disappeared
Retool staff confirm legacy code-mode loops are not being deprecated until feature parity with the new loop and that existing legacy loops should keep working, with no near-term deprecation planned. Loop block | Retool Docs
The current Loop block guide documents iterating over an array with value/index, confirming loops remain a supported, functioning workflow feature.
The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a , , or . Or by marking this post as the "Solution"! Let us know if you have any feedback here.
Check the loop input at runtime before assuming the old code mode was removed. Since this workflow was inherited, a change upstream could easily turn the input into null or an empty array while the loop itself still works. Logging the value immediately before the loop should narrow that down quickly. If the input is populated there, then comparing the old loop’s behavior with the current Loop block would be the next useful test.
Hi @ferret141! Thanks for your patience! I don't believe the code-mode loop was removed, but let me confirm this internally.
In the meantime, were you able to try out @LaurentStone's suggestion? To test if the problem is upstream, you can add a code block right before the loop that logs or returns the exact value the loop iterates over.
Let me know, and I'll circle back to confirm if code-mode was deprecated - thanks!
@LaurentStone ‘s suggestion helped. There was some convoluted logic upstream that was causing this.
Nevertheless, since I was working on it I put code before it to do the shaping and replaced the loop with the newer version of the block. Though there are many others still in use.
@Jen , while the code-mode loops are still functioning now, is there a hard end-of-life date that everyone should be preparing for?
@ferret141 Glad to hear that the suggestion helped, and you were able to use a newer version of the block for this workflow!
I just checked internally with the Workflows team - there are no plans to hard deprecate the legacy loop block at the moment. We kept support for the legacy block to avoid breaking existing workflows, and we prevent users from creating new ones via the "Add Block" button.
If there are any plans to deprecate this, we will give a heads up in Retool Announcements so you will have time to switch over to the newer loop block.
I believe the team will add a little message on the legacy loop block in-product to make it clear that it is a legacy feature and to use the new one.