Reset loop over items expression

Hello,

I have spent 2 days in innumerable iterations trying to get a reset expression to work properly on a loop over item node, the flow is simple.

I load a list of webpages from a file and loopthem over items to feed an HTTP request for a webscrapper, the output of that is to be analyzed by an Ai agent but the context gets too large, so I use a loop over items to break it in pieces and let the Ai agent extract in parts.

Initially, it works very well, the problem is when the second webpage gets scraped and the JSON is fed into the loop over items in the same interaction.

if the loop node is set to finalized, all the items together old and new are output in the done line of the loop node.

I try to reset the node but I need it to reset only when it receiving the item batch from the HTTP request, but I cant manage a way to make the expression work, I have tried to reset if the name of the previous node is HTTP request, also if the input does not have the noitemsleft context that the loop add but it does not work, I have tri other more complex ones using ID and comparisons.

but it feels this should be easy, I just can get it to work, the node never resets and all items output over done after the first batch is finalized.

This is how a test run went

As you can see, eventually all goes on done, the first result of the HTTP 3 items processed properly, and the rest are bad.

I hope someone can help me.

I have exactly the same problem. In my case I need to loop over each input bloc to process them 1 by one.
When I use a switch, all items are processed at the same time independly of the ordrer the are arriving.

Finaly solved by:

$('LoopName).params.options.reset = "true";

Big thanks to Michael_Nussbaumer

1 Like