Describe the problem/error/question
I am building a n8n workflow which queries the Viator API to fetch all attractions for a destination.
This API is paginated and limited to 30 results per page.
The pagination must be specified in the JSON body of the HTTP request, for example:
{
"destinationId": 522,
"pagination": {
"start": 1,
"count": 30
},
"sorting": {
"sort": "DEFAULT"
}
}
It seems that the integrated pagination option of the HTTP Request node cannot be used in this case because the format is too specific.
So I set up the following workflow:
-
Loop indexes (Loop Over Items - Split in Batches) to generate {start, count} values for each page
-
HTTP Request to call the Viator API with these values
-
Json to Table to split the attractions array into individual items
-
Loop attractions (Loop Over Items - Split in Batches) to process each attraction and call our API to insert it into our database
The issue:
Everything works well for the first page. But starting from the second page, the “done” branch of the “Loop attractions” node is immediately triggered, and the attractions of the new page are not processed.
Everything works well for the first page, but for the second page, the “done” branch of the “Loop attractions” node is immediately triggered.
Question:
What should I change in my workflow so that the “Loop attractions” node executes properly for each page (instead of skipping directly to “done”)?
Thanks in advance.
My workflow
Information on your n8n setup
- n8n version: 1.107.4
- Running n8n via Docker (Kubernetes)
- Operating system: Linux