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?
Hi @JaschaL, first of all, welcome to the community
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
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