SplitInBatches in Multiple Data of Execution

Hey team,
I’m confused about how to use SplitInBatches node. :thinking:

Nine HTTP requests were queried and three results were returned.
There are four objects in each of the three results.
I’m going to divide 4 objects into sets and save them one by one.

However, SplitInBatches2 repeats only once.
Even though there are two left in the Data of Execution.
What I expect is SplitInBatches2 to repeat 12 times (items*DataOfExecution 4x3 = 12).

How do I repeat as many Data of Executions in SplitInBatches2?
please excuse me if I may have missed something, and do feel free to point me at a workflow



Hey @sinagawa! Is there a reason why you are using the second Split In Batches node? If you toggle Execute Once to false, the Execute Command node will execute for all the different executions.

I’ve had the same problem…my guess is the “noItemsLeft” flag for that module never resets for the duration of the workflow once it has been set once…it might be good if we could manually reset it.
My workaround has been to run the second splitinbatches in a separate workflow and execute that.

2 Likes

@harshil1712 Thank you for reply :grinning:

The reason I used SplitInBatches2 is to separate and print out the objects individually.

Convert1 items
Data of Execution 1/2 [{obj1-1},{obj1-2},{obj1-3},{obj1-4}]
Data of Execution 2/2 [{obj2-1},{obj2-2},{obj2-3}]

Final results of the “Execute Command” node.
echo $node[“SplitBatches2”].json[“item”] >> logfile.txt
{obj1-1}\n
{obj1-2}\n
{obj1-3}\n
{obj1-4}\n
{obj2-1}\n
{obj2-2}\n
{obj2-3}\n

so this is the final form of logfile.txt I expect.
{timestamp:2021/06/30 21:11:37, shop.name:Rathausstr, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:11:34, shop.name:Rathausstr, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:11:27, shop.name:Rathausstr, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:11:27, shop.name:Rathausstr, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:12:47, shop.name:Rotees, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:12:17, shop.name:Rotees, owner.name:Henny, telephone:+49-30-90123456}
{timestamp:2021/06/30 21:12:08, shop.name:Rotees, owner.name:Henny, telephone:+49-30-90123456}

And, I toggle “execute once”, but the result is the same.
Only the first data of execution (1 of 2) runs.
Please, what am I missing?