Using Do While Loop Logic in Integration Workflows
You can call actions inside Do While Loop logic sequences to ensure the action is executed at least once so you'll be able to specify the condition(s) when the loop execution should cease.
The iteration limit for Do While Loop logic is 1000 attempts for a single integration event. Once exceeded, the system will fail the workflow and throw an error.
To bypass the Apply to Each and Do While Loop constraints, users can leverage the subflow action or a generic POST request to effectively chain multiple integration workflows, known as the “workflow chaining” approach. This approach involves triggering another workflow’s webhook trigger and passing the necessary data in the API call’s body.
To configure Do While Loop logic
To delete Do While Loop logic
Combining with Apply to Each Logic for Pagination
You can also include Apply to Each logic within a Do While Loop sequence to support next link-based pagination and token-based pagination use cases.
The workflow here includes an Apply to Each step with a nested POST action and a Data Transformation step, all of which is nested under the Do step. The workflow ends with the While step to close the loop.
Within this Apply to Each step a value is selected to loop through each element in the given page of results, which in this case is Office 365 posting to an API call to scan for personally identifiable information (PII).
Next, the Data Transformation is acting upon the response produced by the Apply to Each logic. This stores the next link provided by the GET User Emails call so that the next pass through the loop this URL will get the next page of data.
Finally, the While step specifies the cease conditions for when the execution sequence should stop. In this reference, if no link is returned by the Data Transformation, then the nextPageLink variable is set to NOMORE so it's known if there are no more pages. The While condition checks that nexPageLink does not equal NOMORE so the workflow knows to call the API again to get more emails.