Split In Batches runs only for first execution

Describe the problem/error/question

My problem is that before I do “Split In Batches”, I get 7 items which are in 3 different executions (exe 1 - 3 items, exe 2 - 1 item, exe 3 - 3 items). I want to “Split in batches” for every item, but everything that I have tried, runs “Split in Batches” 3 times, only for the first execution items.

I can’t use the Merge node to combine data so I don’t get separate executions, because I will run workflow also for one item (testing on 7 items). Also, passing an empty value from the node before Merge will not work, because nodes before are “IF” nodes, and “IF” with “Merge” not working as I want for most of the cases.

I also have used Merge data for multiple executions | n8n workflow template but it is not working for this case as well.

Maybe anyone has suggestions on what else I could try?
I know I could duplicate a set of nodes and reuse that for every scenario, but I am so close to getting this working without duplicating stuff :smiley:

What is the error message (if any)?

Screenshot from “Split in Batches” node:


1 Like

Hello. Not sure if I will help here.
A split in batch in a split in batch need a reset.

Im not sure what you mean by “Split in Batch in a Split in batch”. I don’t have a Batch within the Batch.
Maybe this will explain better what I want to do:
First if can return one value or many values, as well as some can be false, some can be true. For true items, I do something and check if it is working for me, if it’s not, Im passing that item to the “Code” node (same thing as the first “IF” false).

I think I understand.

When a split in batch is solicited, it will run a loop for each time it had receive item at the first call… until the reset. And the reset should start the second call…

I didn’t do test, no sure about what I said ^^

But I was confront of this and I use split in bach winthin a other split in batch

If I enable reset on Split in Batches node, it will reset after the first run and will try to run the same item again. Another problem is that the False item from the first IF will arrive faster than from the second if, and with reset, it will try to rerun the same False item from the first if.

I still not wrapping my head around how I can use Batch within another Batch :smiley: In your node, you are checking “noItemsLeft” for the same node, and I got the same result as I mention above (checking same item twice)

This workflows had example data, try to see if it’s usefull for you.
I will try to recreate your situation (lately today, not now)

I played around with your workflow and I still cant get that nodes after first batch executes for every item from all executions. In your workflow, first batch gets one execution, but im my case, first batch gets 2 (or more) executions.

I modify your execution that first batch gets 2 executions. Maybe you can check this examples?

parallel workflow always get me mad. Try to have only one way and call specific node when you need data from few node before.

Sorry I don’t have much time for make a lot of test

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