Original explainer
n8n HTTP pagination: inspect next-page and stop conditions
Read the API pagination contract before choosing parameter updates or a next-page URL; inspect counts, duplicates and termination.
When collecting input for an AI workflow, the first HTTP response may be only one page. Define a contract and acceptance checklist for a synthetic two-page API. You need permission to access the API, its pagination documentation and an editable HTTP Request node. No real API, credentials or node execution was used.
Action and acceptance sequence
Read the contract
Identify how to locate the next page and detect the end.[1]
Choose a mode
Choose parameter updates or a response-provided next URL.[1]
Check completeness
Check record IDs, page count, duplicates and the end marker.[1]
Start with API documentation
Original page one contains demo-1, demo-2 and a next field; page two contains demo-3 and an empty next. Expect three distinct IDs. Determine whether the service uses page numbers, cursors or next URLs, plus page-size and termination rules. Do not assume every API accepts $pageCount as a request parameter. The next field name belongs to this exercise only.[1]
Choose the appropriate mode
Pagination Mode offers Off, Update a Parameter in Each Request and Response Contains Next URL. The parameter mode updates request parameters; the URL mode uses an expression for Next URL. Configure against the actual response shape and confirm the field exists. If the API supplies a cursor rather than a URL, follow its parameter contract.[1]
Inspect each request and response
Documented variables include $pageCount, $request and $response, whose body, headers and statusCode are available. Use the response shape to inspect next-page information and record fetched pages and IDs. Pagination is separate from Batching multiple input items; setting Items per Batch does not establish that all server pages were fetched.[1]
Stop conditions and verification scope
Pause requests when next-page information repeats, IDs duplicate, authentication fails or termination is unclear, and inspect the contract. Set request boundaries consistent with the API limits when adopting it. Offline checks covered distinct synthetic IDs and the empty next marker only. No n8n, API or rate-limit behavior was executed; verify real completion from actual requests and responses.[1]
Article sources
Original editorial content; official descriptions and checking suggestions are distinguished.