studio-web
latest
false
- Release notes
- Getting started
- For administrators
- RPA workflow projects
- Creating an RPA workflow from an idea
- Creating a project
- How to start an RPA workflow
- Managing project files and folders
- Connecting RPA workflows to your accounts
- Configuring activities
- Managing the activities in a project
- Passing values between activities
- Iterating through items
- Managing the data in a project
- Configuring a project to use your data
- Using file and folder resources
- App projects
- Agentic processes
- Agents
- Solutions - Preview
- API workflows - Preview

Studio Web User Guide
Last updated Sep 22, 2025
Paging over HTTP calls
linkThe following tutorial demonstrates how to use the Do While activity to handle API pagination by making repeated HTTP calls until all data is retrieved.
Pagination indicators, such as cursors, end-of-page flags, or limits, are typically included in the response headers, response body, or as query parameters.
This example retrieves a list of breweries using the OpenBreweryDB API. According to the OpenBreweryDB API specification, pagination is handled using offset-based (page-based) parameters. To paginate through the dataset, include per_page=X&page=Y as query parameters in the HTTP request.
- Create an API workflow.
- Add a HTTP activity and configure it as follows:
- Method—GET
- Request URL—
https://api.openbrewerydb.org/v1/breweries?per_page=10&page=1
https://api.openbrewerydb.org/v1/breweries?per_page=10&page=1
- Debug your API workflow to retrieve the first listing of breweries.
- Add a Script activity and provide the following code:Using $input instead of $context ensures you always reference the output of the last executed activity, especially inside a loop block. The JavaScript code returns a JSON object with nextPage and content properties. These properties allow you to control the loop, for example: continue while nextPage < 10 or content is not null.
const url = new URL($input.request.url); const currentPage = Number(url.searchParams.get("page")); return { nextPage: currentPage + 1, content: $input.content}
const url = new URL($input.request.url); const currentPage = Number(url.searchParams.get("page")); return { nextPage: currentPage + 1, content: $input.content} - Add a Loop > Do While activity above the existing HTTP activity.
- Move both HTTP and Script activities inside the Do While activity body.
- Set the Condition for the Do while activity to
$input.nextPage < 5
. - For the HTTP activity, open the Expression editor of the Request URL property and update the expression to:
"https://api.openbrewerydb.org/v1/breweries?per_page=10&page=" + ($input.nextPage == null ? 1 : $input.nextPage)
"https://api.openbrewerydb.org/v1/breweries?per_page=10&page=" + ($input.nextPage == null ? 1 : $input.nextPage)
- Debug your workflow again and notice the result array in the Output tab of the Run output panel.
- Outside of the Do While activity, add a Response activity and configure it as follows:
- Type—Success
- Details—Open the Expression editor and write the following:
$context.outputs.Do_While_1.results.flatMap(result => result.content.map(brewery => brewery.name))
$context.outputs.Do_While_1.results.flatMap(result => result.content.map(brewery => brewery.name))
- Copy the result from the Output tab of the Run ouput panel and configure it as an Output schema:
- Open the Data manager panel.
- In the Output tab, select Generate From Payload.
- Paste the copied result, and select Generate Schema.