Move to next item execution in Loop if Error

Hello,
I have a loop created using Split in Batches Node, because I want the loop to run for the specific item and then move to another and so on. But for some item(s), in the list of items that are running in the loop, I get an error. My question is: Is it possible to skip this item in the loop and continue with the next item? If yes what is the best approach? If not, do you have any advice, how can I resolve the issue? I’m looking for some kind of logic as (catch Error and continue) in traditional programming loops.

I have created test workflow to show you what I mean. The wanted result would be that browser will console.log all of the foo variables, that have smaller id than 5.

I’m using n8n cloud version.
Thank you for any advice

Hey @Sabr3,

It might not be exactly what you are after but in your Code2 node if you go to the Settings for the node you can set it to Continue On Fail what this will do is just carry on and ignore the issue.

If you do use this you would then need to process your errors later in your worklfow but hopefully this helps.

OK, thanks for the advice, I can use that elsewhere. But for my workflow, I think I must handle the possible errors manually.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.