Split in Batches until no Item is left (Loop)

Hello N8N Community,

I have a problem in correctly using the SplitInBatches Node for a Fileprocessing Workflow and I can’t seem to solve it myself.
All my attempts end in either a one time run or a permanent loop.

The Workflow reads a Google-sheet which contains a table.
I want the SplitInBatches to cut it every 100 Rows (which in theory works just as intended)
Then I use those 100 Rows in my Function.
When it’s done with those 100 it should circle back to the SplitInBatches Node and get the next 100 until there are none left (obviously).
But instead it keeps using the same 100 from the first Run (which leads to the infinite Loop)

As I said, my problem is, I either have a OneTime Run or an infinite Loop which forces me to restart N8N.

Would be awesome if someone could help me.
I have checked multiple templates and the documentation already but I keep running into the same problem.


Hey @Bennse,

Welcome to the community :tada:

Can you share the workflow so I can take a look at what options are being used in the nodes?

Hey @Jon ,

I actually got it working like 20 Minutes ago, forgot to mention it here.
The Problem was in the IF Node…
One Value was the context[“noItemLeft”] from SplitInBatches Node which seems to not work as I thought it would.
I swapped it over to the RunIndex from the SplitInBatches Node and it suddenly worked.

Thanks for the reply though, wasted a whole day yesterday trying to figure out what is wrong.

1 Like