This function card is only available in Workflows Connector Builder.
Use a helper flow to paginate through multiple pages of an HTTP response.
For additional best practices when using the Paginate function card, see:
The internal paginate function that exists in Workflows today is essentially a Do While loop that looks for a
break keyword in order to decide whether to keep looping. When the loop starts, an object is passed into the Object field of the function, and the values within that object are managed within a helper flow. As the values in that object get updated, they are returned to the function and the object again gets passed back into the helper flow with the updated values.
Proper use of the
break field is very important to the paginate function. If it is not used properly, the flow could run until the platform hits a maximum count of 5,000 iterations. In order to stop the iteration, the
break field must be removed from the object.
|Object||Object passed into the helper flow. This can hold any number of keys and values such as
|Path||Key for the field in the Object input to monitor for when to stop the loop. This is commonly called
|Helper Flow||Flow used to process the object passed into the Object input field.||Flow||TRUE|
Object containing the new values.
In this example, you want to iterate only a certain number of times. This should be your first task when you begin working with pagination and will help with testing your flows. You will need to create an object with three values that will get passed to your helper flow. These are examples of key names:
page_index: Current count of iterations.
max_page_index: Maximum number of times that the helper flow should iterate.
break: Value to monitor for when to stop the loop.
In the helper flow, the inputs that you defined on the event card will need to match the keys defined in the object above:
break. You can then use these within your flow. You can use the Number Add function card to increase the
page_index on each iteration, and return that new number to the Paginate function card.
The counter will increase as the flow continues to iterate. Once
page_index hits 10, the
break condition should be removed from the object to stop the iteration.