<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Paginating API Results Using the HTTP-Paginate Card in the Okta Workflows Connector Builder

Okta Classic Engine
Okta Identity Engine
Workflows

Okta Workflows can paginate API results in the Connector Builder by passing a pagination object through the  HTTP-Paginate card in the Okta Workflows Connector Builder until a stop condition is met. This pattern uses a main flow to start pagination and a helper flow to fetch each page, accumulate results, and return the final list.

 

How does the HTTP-Paginate card handle pagination?

The HTTP-Paginate card works like a Do While loop — it repeatedly calls a helper flow, passing an object through each iteration until a stop condition is met. This example pages through the Random User API, accumulating results across multiple pages into a single list. The automation has 2 flows:

 

  1. Main: sets up the initial pagination state and starts the paginator.
  2. Helper: fetches each page, accumulates results, and determines whether to continue or stop.

Note: The HTTP-Paginate card is only available in the Okta Workflows Connector Builder. It supports a maximum of 5,000 iterations.

The main flow starts the pagination state

The Main flow sets up the initial pagination state and passes it to the HTTP-Paginate card.

 

The Main flow showing the Object-Construct and HTTP-Paginate cards.

How does the main flow work?

  1. The Object-Construct card builds the initial pagination state object with:
    • Starting page number
    • max page limit
    • break flag set to False
    • API url
    • Empty result list
  2. The HTTP-Paginate card takes the pagination object, repeatedly calls the Helper flow on each iteration, and returns the final accumulated result once pagination is complete.

 

The helper flow fetches each page and determines when pagination stops

The Helper flow is called by HTTP-Paginate on each iteration. It fetches one page of results, adds them to the running list, and signals whether to continue
or stop.

 

The Helper flow. Click the image to see a larger version.

How does the helper flow work?

The Helper Flow card receives the current pagination state as inputs:

    • page number
    • max page
    • break flag
    • url
    • Accumulated result list

The helper flow fetches, combines, and returns pagination data with these cards:

  1. The Text-Compose card builds the URL for the current page by appending the page number as a query parameter.
  2. The HTTP-Raw Request card makes a GET request to the URL
  3. The Object-Get card extracts the results array from the response body.
  4. The List-Union (Combine Unique) card merges the new results with the accumulated result list from previous iterations.
  5. The Number-Add card increments the page counter by 1.
  6. The Object-Construct card builds the updated pagination state with the new page number and combined results.
  7. The Branching-If/Else card checks whether the next page is less than or equal to the max page.
    • If yes, the Flow Control-Assign card passes the next pagination state back to
      the HTTP-Paginate card, and the loop continues.
    • If not, the Object-Unset card removes the break field from the pagination object, signaling HTTP-Paginate to stop and return the final result.
  8. The Flow Control-Return card returns the pagination object to the HTTP-Paginate card, which uses it to determine the next iteration.

 

What result does the flow return?

The Random User API requested 5 pages of users (5 per page), for a final total of 25 records.

 

The final result — 25 records after paginating through 5 pages.

 

The HTTP-Paginate card fetches results, accumulates them across iterations, and stops after the helper flow removes the break field from the pagination object.

 

Related References

 

 

Recommended content

Loading
Okta Support - Paginating API Results Using the HTTP-Paginate Card in the Okta Workflows Connector Builder