> For the complete documentation index, see [llms.txt](https://docs.locoia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.locoia.com/automation/flow-builder/automatic-pagination.md).

# Automatic Pagination

Making complex pagination as easy as a click of a button

## Overview

Pagination is used by APIs to divide a large amount of data into smaller chunks that are more manageable to retrieve and transfer.

### Manual pagination

If you implement pagination manually in a flow, you have to use

* a Looper,
* a special loop condition,
* sometimes a Dict Helper references the actual list of entities in the response, and
* a Dict Helper to flatten the loop's output

in order to get the results from all pages from a Connector.

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FNzdatMUjrqQKvNqU5dgl%2Fimage.png?alt=media&amp;token=712f9a8a-2c20-4f27-9bad-e7834d89b156" alt="" width="563"><figcaption><p>Manual way of getting results from all pages</p></figcaption></figure>

### Automatic pagination

With Automatic Pagination the process is much simpler: Just toggle the **Retrieve all data** switch button on supported actions:

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FfREOAQ2iMndGF3tYiKtu%2Fimage.png?alt=media&amp;token=35a9071c-52c4-4519-b5eb-25d12742717d" alt="" width="563"><figcaption><p>Retrieve all data option</p></figcaption></figure>

This will automatically do the entire pagination logic and will output a nice 'flat' list of records, ready to be further used inside the flow, thus replacing the manual 4-step process with a button click.

{% hint style="info" %}
The maximum number of pages is currently limited to 100 pages.

Please contact us in case you're running into this limitation.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.locoia.com/automation/flow-builder/automatic-pagination.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
