After a SplitInBatches

Hello

I just used the SplitInBatches node for the first time. Not very natural for a beginner but it works.

As you can see I have 60 items arriving on the SplitInBatches. It loops over 60 lines. Perfect.

At the end, after the IF, I want to continue with my 60 items with their data.
How to do ?

Thanks

Hi @vanitom,

Do you want to get your all items back from the node that right before ‘SplitInBatches’ node?

If this is the case, in Function Node you can get items from any node with this method: $items(<Your Node Name>);

You can find an example below for this case.

However, if you need all items from a node that inside the SplitInBatches loop, you can still use the above method with it’s parameters. Example;

const allItems = $items('<Your Node Name>');
var allNewItems = [];

for (let i = 0; i < allItems.length; i++) {
   allNewItems.push($items('<A node which is inside the SplitInBatches>',0,i))
}

return allNewItems;

You can find more information about methods on n8n Documentation.

Hope it helps…

2 Likes

Thanks for your return.
It worked well with a little different operation

Here is the code for my Function node. Quite simply

return $items('<My Node Name>');