logo
search
Others

How to Create a Power Automate Loop Based on HTTP Message Count

Ayan MasoodAyan Masood Oct 1, 2026 868 views

Question details

The user needs to process an entire batch of messages returned by a MuleSoft HTTP API in Power Automate, rather than consuming just a single message from the queue.

How to Create a Power Automate Loop Based on HTTP Message Count
Product
Power Automate
Device & OS
not provided
Scenario
Integrating a MuleSoft HTTP API with a Power Automate flow to retrieve and handle multiple queued messages consecutively.
Observed behavior
The current flow setup only processes one queue message at a time, failing to iterate through the complete HTTP response message count or array.
Before you start

Ensure you have the exact JSON response structure from your MuleSoft HTTP API, as the correct loop configuration depends on whether the API returns an array of messages or a specific total count property.

Solution 1Recommended

Configure an Apply to each or Do until Loop in Power Automate

Use Power Automate's built-in looping actions to iterate through the HTTP response array or count property, ensuring all messages are processed.

To process multiple messages from an API call, you must dynamically instruct Power Automate to repeat your processing logic for every item returned. This prevents the flow from stopping after reading only the first message in the queue.

1
Parse the HTTP Response

Add a 'Parse JSON' action immediately after your HTTP request. Provide the response body and the corresponding schema so Power Automate can identify the message array or the message count property.

2
Add the Looping Action

If your parsed JSON contains a list of messages, add an 'Apply to each' control and select the message array from the dynamic content. If the API provides a message count, initialize a variable and use a 'Do until' control that runs while the variable is less than the total count.

3
Process and Acknowledge

Inside the loop, insert your desired actions to process the data. Critically, add an HTTP or API action to acknowledge or delete the processed message from the MuleSoft queue so the flow does not repeatedly consume the identical item.

Configure an Apply to each or Do until Loop in Power Automate
Seek Advanced Community Support: Because specific flow behaviors depend heavily on your MuleSoft configuration, posting your current flow design and HTTP response structure in the Microsoft Power Automate Community can help you get tailored advice.
Free Microsoft Office alternative

Boost Your Productivity with WPS Office

While Power Automate handles your complex API workflows, you still need a reliable, fast, and free office suite to document your integrations, analyze API data in spreadsheets, and prepare presentations.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install the Software: Run the setup file and follow the quick installation prompts to get the suite ready on your device.
  3. 3. Start Creating: Open WPS Office to instantly create, view, or edit Microsoft Office formats without compatibility issues.
Free, lightweight, and fast-loading office suiteFully compatible with Microsoft Word, Excel, and PowerPoint formatsEasily document API responses and logic in WPS WriterAnalyze parsed JSON data using WPS Spreadsheet
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Power Automate flow only process one message?

Your flow might be missing a looping action. If the HTTP request returns a batch or array of messages, you must use an 'Apply to each' action to iterate over the entire array instead of just reading the first index item.

What is the difference between Apply to each and Do until in Power Automate?

'Apply to each' runs a set of actions for every item present in a specified array (like a list of API messages). 'Do until' repeats actions endlessly until a specific condition evaluates to true, such as a variable for the processed message count reaching the total limit.

How do I prevent processing the same queue message multiple times?

Inside your loop, you must include an action to acknowledge, update, or delete the message from the source queue immediately after it is processed. This ensures the next iteration or flow run does not fetch the exact same item.