Option to purge data between loops

The idea is:

To have an option to purge data between loops.

My use case:

I have 3 batch split in loop where i get some data, loop over them and do some api requests, them save to database.
I’d really to love have option to clear data between loops.

I think it would be beneficial to add this because:

Right now i have a problem with my workflow because old data is store so api request using multiple times the same data each loop.

I find post from @MutedJam here Channel closed Error - #2 by Edmunds_Priede about some way to do this other way but when I have 3 or more split batches itss gonna be non ususable with 3 child workflows to use.

Or maybe there’s some way to purge data with some code node?

Hi @rafuru, Have you tried to add a “set” node and enable the function “Keep Only Set”?
Should return an empty output

Can you post an example of your workflow and where you’d want a purge action to happen and to which nodes?

As mentioned the current way to approach this is to take your memory heavy nodes and run then in a sub workflow that cleans up its memory once finished. And a natural boundary for this is where you have a Split in Batches node.