Hello,
I’m having hard time with the pagination of HTTP request component.
There are some options in this node which is great, but I’m unable to make it work.
I’m facing the message “The returned response was identical 5x, so requests got stopped” and I don’t know what to do.
I want to use the feature " Pagination Complete When" with “Other” and “Complete Expression”.
Let’s get this API, which gives a similar return of the one I’m working with ( this one needs no authentication so it’s more convenient to share it ) :
https://pokeapi.co/api/v2/pokemon :
- Status code 200, so I can’t use the option checking the status code
- I would use “the response is empty” because “reults” is empty but n8n doesn’t know this path contains the data, so it doesn’t work, that’s fine.
- The array that contains items is just empty. This is what I want to check to define if all pages have been paginated.
Here is my “workflow” :
The $response autocompletion is showing the right fields :
I’ve tried
{{ $response.body.results.length === 0 }}
// ==> The returned response was identical 5x, so requests got stopped
{{ $response.body.results.length > 0 }}
// => No error, but just one page if fetched.
{{ $response.body.results[0]?.name == "undefined" }}
// ==> The returned response was identical 5x, so requests got stopped
No matter what, I see just one call in the console, and the best I have is finishing with just one page of 60 records.
In the console, we can’t see the response, pageCount, body. So it’s pretty hard to know what’s happening. We can’t use console.log in this context.
I was looking for examples of how am I supposed to use this feature, I’ve found some tests here :
but the only ocurrence is
"paginationCompleteWhen": "other",
"completeExpression": "={{ $response.statusCode === 404 }}"
I’ve also tried to =make it “the old way”, with loops in old posts and all, but lot of things have changed and it didn’t work for me.
I’m probably missing something big, because it’s a very common problem, and I’m surprised it’s that hard to solve it. Unless there’s a bug.
Thanks for your help
Information on your n8n setup
- n8n version: [email protected] Beta
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
- Operating system: Windows 11