Collect all data first, then proceed

Hi guys, I’m really struggling with this one!

I have a workflow that should first collect all data from a paginated API, then send it one by one to another API.

Collecting all data works, but when the “IF” Node switches to false (no more data to fetch) and I want to proceed, I don’t seem to be able to access the data I collected.
The only data I still get is the one I don’t need, because the last loop returns empty data, which made the IF-Node turn to false in the first place.

So, long story short, is there any possibility to access the previous requests after IF-Node?

Thanks a lot in advance!

Please share the workflow

Hi @JaschaL, first of all, welcome to the community :tada:

You can access items from a previous loop execution using for example the .items() method which allows you to specify a run index.

A simple approach using this to merge data from multiple HTTP Request node executions into a single set of items could look like below. This example uses a dummy API since I don’t have access to Fastbill, but I hope it’s still useful. You can copy it straight into your n8n canvas:

Example Workflow

Hope this helps! Let me know if you run into any trouble with this :slight_smile:

Hey @MutedJam, sorry for answering late, I could test it today, works great, thanks a lot!

How Can I ask in next node (after merge loop data) for full merged data only? I want to merge data from 2 loops (max 1000 items pagination), it works but every next action is running at first for 1000 items then 1000 + rest. In case with ex merging 5 loops (1000 items each) it creates 5 XMLs and 5 times upload file to FTP

1 file - 1000 items
2 file - 2000 items
3 file - 3000 items
4 file - 4000 items
5 file - 5000 items

Is there option to use just one last data bundle with 5000 items in next nodes after merge loop data?