Split in batches node not working as expected

Describe the problem/error/question

I am getting POC data from apollo which I need to do some mapping with . Apollo does not give the entire data at once but divides into pages and hence make separate request for every page. Each page has 30 entries . I want to loop through the 30 entries one by one and do some operation (here I simply appened in google sheet since actual workflow is very long). After the 30 entries is completed I would go and fetch the next page of 30 entries.

What is the error message (if any)?

The problem is Split in Batches node works fine for the first iteration(page of 30 entries ) , but in upcoming iteration it does not loop and directly goes to the done branch. Is there any way to fix it or any other alternative ?

Please share your workflow

Hi @Shiv_Jyoti_Garai, it seems you have two overlapping loops here (your Google Sheets node connects back to the Split in Batches input as well as does your Wait node via a couple of other nodes). From looking at this I am not quite sure what exactly you would be expecting in such a workflow.

I am not familiar with apollo, but it seems their API supports pagination which means you wouldn’t need Split in Batches. Perhaps you want to try and build a simpler loop without the Split in Batches node? Like so for example:

If you want to fetch all results after finishing paginating you can use an approach like this on the IF node’s true output: Merge multiple runs into one | n8n workflow template

Hope this helps!

1 Like

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