Describe the problem/error/question
When using the HTTP Request node along with pagination, the node will never error despite the response code.
If i remove pagination it works fine
What is the error message (if any)?
The node simply returns the error output as regular output when pagination is configured
Please share your workflow
Share the output returned by the last node
[
{
“code”: 403,
“description”: “Forbidden”
}
]
Information on your n8n setup
- n8n version: 1.77.3
- Database (default: SQLite): postgres
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): gcp cloudrun
- Operating system: serverless
I have another issue being caused by this same behavior now.
When an HTTP request on page 2/3/etc of a paginated request fails, it breaks obtaining additional pages and simply returns a partial output (where the last and failed page outputs an error value as part of it’s regular out as a page instead of catching it. This is also prevents “retry on fail” or engage and i see data issues downstream from these data sources being incomplete
I solved my issue here actually. So I will post it here for anybody else who have have made a similar issue.
The core of the issue in this case was an issue with how the pagination complete expression was set
I had it set to simply:
{{ !$response.body.nextPageToken }}
So this only instructed the node to finish (gracefully) whenever there was no nextPageToken supplied, despite an error response.
I have updated the pagination complete expression to be inclusive of status code now and everything works as expected
{{ !$response.body.nextPageToken && $response.statusCode == 200 }}