Overview
The Paging node provides generic paging (pagination) functionality for APIs that do not natively support or expose paging mechanisms. It is designed to be used in workflows where you need to repeatedly request data in chunks, incrementing a value (such as an offset or page number) on each iteration, and then collect or process the results according to different strategies.
Common scenarios:
- Fetching large datasets from APIs that require manual handling of pagination.
- Looping through API endpoints with custom start, step, and maximum values.
- Aggregating results across multiple paged requests, or selecting only the last, longest, or shortest result set.
Practical examples:
- Downloading all user records from an API that returns 100 users per call by incrementing an offset parameter.
- Collecting all pages of search results until no more data is returned.
- Comparing the size of result sets across pages to find the largest or smallest batch.
Properties
| Name | Type | Meaning |
|---|---|---|
| StartValue | Number | The initial value to use for paging (e.g., starting offset or page number). |
| StepValue | Number | The amount to increment the paging value on each loop/iteration. |
| MaxAmount | Number | The maximum value to be requested per call (e.g., max items per page/request). |
| Result | Options | Determines how results are collected: - All Collected: aggregate all results - Last List: keep only the most recent result - Longest List: keep the result set with the most items - Shortest List: keep the result set with the fewest items |
Output
- The node outputs a JSON object with the following structure on its secondary output:
{
"runIndex": <number>, // The current run/iteration index
"index": <number>, // The current paging value (e.g., offset/page)
"maxAmount": <number>, // The maximum value per request
"count": <number>, // The count of items collected so far
"steps": <number> // The step value used for paging
}
On the primary output, it emits the collected data according to the selected "Result" strategy (all, last, longest, shortest).
Binary Data: This node does not output binary data; all outputs are in JSON format.
Dependencies
- No external services or API keys are required.
- The node relies on n8n's context and input/output mechanisms.
- No special environment variables or configurations are needed.
Troubleshooting
Common issues:
- No data returned: If the input data is empty or improperly formatted, the node may not perform any paging.
- Incorrect property values: Setting inappropriate values for StartValue, StepValue, or MaxAmount can lead to infinite loops or missed data.
- Unexpected result aggregation: Choosing the wrong "Result" option may cause the node to return only a subset of expected data.
Error messages and resolutions:
- "Cannot read property 'json' of undefined" — Ensure that the previous node outputs valid JSON data.
- "Input data is empty" — Check that the workflow is passing data into the Paging node.
- "Invalid parameter value" — Verify that StartValue, StepValue, and MaxAmount are numbers and within reasonable ranges.