Skip to content
Guides

Make.com Custom App Pagination and Error Handling

In this video

This is the written version of Level 5 of Build your own Make app. Your search runs. It says success. And it returned exactly one page of results, while the rest sit there untouched.

A quick note before we start, because "Make error handling" means two things. If you're building scenarios and want error handler routes, that's a different topic. This guide is about error handling inside a custom app's code: what your app tells Make when the API says no, so that Make reacts the right way in every scenario that uses it.

By the end, every search fetches every page, stops at the right moment, and turns your API's errors into types Make knows how to handle. It builds on the search module and the Limit field from Level 4. The example API is Acme CRM, which is invented, so its endpoints and field names are made up. The Make syntax is from Make's developer docs.

Why page one isn't a bug

Most APIs don't hand you everything at once. They hand you a page, maybe fifty records, and somewhere in the reply they tell you how to ask for the next one.

Your module doesn't know that. It sent one request, got one reply, and as far as it's concerned the job is done. No error. Just missing data. It's the most common way a Make app quietly loses data.

The pagination directive

In Make you describe the next page with the pagination directive. It sits at the root of the request, next to url, method and response, and says what to change for each new request. Its qs and headers are merged with the original request.

Page numbers

For a page-number API it's one line. Make counts pagination.page for you, and it starts at 1, so after the first request it's 2, then 3:

{
    "url": "/customers",
    "method": "GET",
    "qs": {
        "page": 1,
        "per_page": 100
    },
    "pagination": {
        "qs": {
            "page": "{{pagination.page}}"
        }
    },
    "response": {
        "iterate": "{{body.data}}",
        "output": "{{item}}",
        "limit": "{{parameters.limit}}"
    }
}

Offsets

For an offset API, work the offset out from the page, with a fixed page size in the request's qs:

"pagination": {
    "qs": {
        "offset": "{{(pagination.page - 1) * 100}}"
    }
}

Tokens and next-page links

If your API gives you a token instead, send the token from the last reply, and add a condition so Make keeps going only while there is one:

"pagination": {
    "qs": { "nextPageToken": "{{body.nextPageToken}}" },
    "condition": "{{body.nextPageToken}}"
}

Same idea for a next-page link. Use it as the URL, and stop when it's gone:

"pagination": {
    "url": "{{body._links.next.href}}",
    "condition": "{{body._links.next.href}}"
}

The condition can see the last response's body, headers and temp.

Page 2 and beyond: three ways it goes wrong

1. Your API counts from 0

pagination.page starts at 1. If your API's first page is page 0, you skip it and never notice. Start the request at 0 and subtract one in the directive:

"qs": { "page": 0, "per_page": 100 },
"pagination": {
    "qs": { "page": "{{pagination.page - 1}}" }
}

2. It never stops, or stops too early

Make stops by itself when a page comes back with no records, or when the module's Limit is reached. That's the Limit field from Level 4, wired in through response.limit, and it's why that field matters so much. When the user sets a Limit, the module returns no more than that number.

3. Pages are tiny, so you hit the ceiling

Make has hard limits per module:

  • at most 50 pagination requests
  • at most 3,200 paginated records
  • a 40-second call timeout, and any pagination delay counts toward it

With 50 records a page, 50 requests can't get far. Make's advice is a page size as large as possible, so ask for the biggest page your API allows.

Error handling with error types

When your API says no, Make doesn't just need a message. It needs a type, because the type decides what happens next:

  • RateLimitError: the scenario is suspended for a delay (about 20 minutes by default), then resumed. It doesn't count toward consecutive errors.
  • ConnectionError: Make backs off and retries.
  • DataError: if the user has "Store incomplete executions" on, the bundle is stored so they can fix it and carry on. Otherwise it behaves like a RuntimeError.
  • InvalidAccessTokenError: the scenario is turned off and the user is told, so they can fix their connection.
  • RuntimeError, the default: the run is stopped and rolled back. The scenario turns off only after several errors in a row (3 by default).

By default Make picks a type from the status code: 429 is RateLimitError, 500 to 599 is ConnectionError, and other 4xx codes are RuntimeError.

You can set your own type per status. Put it in the Base so every module gets it:

{
    "response": {
        "error": {
            "message": "[{{statusCode}}] {{body.error.message}}",
            "400": {
                "type": "DataError",
                "message": "[{{statusCode}}] Invalid data: {{body.error.message}}"
            },
            "401": {
                "type": "InvalidAccessTokenError",
                "message": "[{{statusCode}}] {{body.error.message}}"
            },
            "409": {
                "type": "DuplicateDataError",
                "message": "[{{statusCode}}] {{body.error.message}}"
            }
        }
    }
}

Each status key needs a message. Make's advice is to always include the status code and take the message from the API's response, so the user sees "[404] The specified contact was not found." rather than "Error: contact_not_found". Error handling in the Base and connection is also on Make's review checklist.

One trap: don't set a single type at the top of response.error. It applies to every status and quietly replaces the defaults, including RateLimitError for 429 and ConnectionError for 5xx. Your rate limits would stop being paused and retried.

If your API returns errors with HTTP 200, use response.valid to mark those replies as failures:

{ "response": { "valid": "{{!body.error}}" } }

What NativeShip does, and won't do

We build NativeShip, which turns an OpenAPI spec into a Make app, and this is the level where it says no most often.

If your spec describes how a list pages, it generates the pagination for you, for three styles: page numbers, offsets, and cursors sent in the query string. The generated Base also gives errors types per status, for example 400 as DataError, 401 as InvalidAccessTokenError and 409 as DuplicateDataError.

Here's where it stops. If the next page comes as a link, or the cursor goes in the request body, it keeps that list to one page on purpose and tells you, rather than ship IML that has never been run against the real Make. You'd write those directives by hand, using the examples above. And if a list looks paginated but your spec doesn't say how, it warns you that only the first page is fetched.

Test it with tiny pages

One trick before you ship. Set the page size to something tiny, like 10. Make enough test records with Flow Control > Repeater, then run your search. In Make DevTool (the Chrome extension) you'll see each page as its own request. If you see one request, you've still got the bug.

Make's reviewers look for this too: the review checklist asks for pagination on searches, triggers and RPCs when the API supports it, and for test runs whose logs show it.

What you have now

  • searches that fetch every page, whatever style your API uses
  • pagination that stops on an empty page or at the Limit
  • errors with types, so Make pauses, retries, stores or stops for the right reason

Next, in Level 6: triggers that wake your scenario up, and the bug where the same customer shows up twice. If you missed the start of the series, Level 1 asks whether you need a custom app at all, Level 2 builds the first one, and Level 3 adds the connection. Later: Level 7 for dropdowns and polish, Level 8 for Make's review, and Level 9 for the same app from a spec.

We build NativeShip, which writes the pagination it can trust and tells you plainly about the lists it left on one page. Everything in this guide works without it.

Frequently asked questions

The module sends one request and stops. Add a pagination directive to its communication that says what to change for the next request, such as "page": "{{pagination.page}}" or the next-page token from the last reply.

At 1. After the first request it is 2. If your API counts pages from 0, send {{pagination.page - 1}} instead, or you'll skip a page.

A module can make at most 50 pagination requests and handle up to 3,200 records in a run, with a 40-second call timeout. Ask for the biggest page size your API allows.

Use response.error in the Base or module. Give it a message with the status code and the API's own error text, and set a type per status, such as DataError for 400 or InvalidAccessTokenError for 401. The type decides what Make does next.

It suspends the scenario for a delay (about 20 minutes by default) and then resumes it, and it doesn't count toward the consecutive-error limit. Make uses it for HTTP 429 by default.

Ready to launch your n8n, Make, Zapier or Activepieces integration?

Give your customers another way to use your product.

Get started