Share via

Do actions inside a ForEach loop count separately towards action executions in Logic Apps?

Nandu S Raj 105 Reputation points
2025-09-01T11:02:18.4866667+00:00

I'm working with a Logic App Standard workflow that includes a ForEach loop. Inside the loop, I have multiple actions like HTTP calls, Parse JSON, and Condition.

I want to understand how the billing and usage metrics work in this scenario?

  • Does each action inside the ForEach loop count separately for every iteration?
  • For example, if I have 3 actions inside the loop and the loop runs 550 times, does that mean 1650 action executions?

I'm trying to design my Logic App with cost and quota limits in mind, so any clarity on this would be helpful. I am using consumption plan FYI

Thanks in advance!

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2025-09-02T04:41:31.41+00:00

    Hi Nandu S Raj,

    Thanks for Posting your Question in Microsoft Q&A Forum,

    Yes, as Marcin Policht mentioned The Consumption model includes an initial number of free built-in operations, per Azure subscription, that a workflow can run. Above this number, metering applies to each execution, and billing follows the Actions pricing for the Consumption plan

    Refer document: Usage metering, billing, and pricing - Azure Logic Apps | Microsoft Learn

    Recommended practices to optimize costs and stay within quota limits- Optimize Usage: Minimize the number of actions inside the loop to reduce costs.

    • Concurrency Control: Azure Logic Apps can run multiple iterations of the ForEach loop in parallel (default is 20), which speeds up processing without increasing action count but can improve efficiency. Helps avoid hitting connector throttling limits.
    • Use Child Workflows: For very large loops, breaking tasks into smaller child Logic Apps can help manage costs and performance.
    • Monitor Execution Counts: Use Azure Monitor to track billable action executions and optimize your Logic App workflow accordingly.
    • Move expensive work out of loop if possible Example: Instead of parsing JSON 550 times, parse once outside the loop.
    • Optimize Connectors: Use built-in connectors (e.g., HTTP, SQL, Service Bus) whenever possible, as they provide better performance and lower latency. Limit the use of managed connectors unless absolutely necessary, since they incur the same per-action billing.
    • Consider Logic Apps Standard (fixed pricing) if you expect very high volume, Standard plan may be more cost-effective since it’s not per-action billing.

    If your workflow runs only a few times per day → Consumption is cheaper because you only pay for what you use.

    If you have loops with thousands/millions of iterations → Standard can be much cheaper since you’re not charged per action execution.

    Refer document to have clear vision on cost and quota limits: Limits and configuration reference guide - Azure Logic Apps | Microsoft Learn

    Review the following document to understand the differences between the Consumption and Standard plans. It will help you decide which option best fits your requirements

    https://learn.microsoft.com/en-us/azure/logic-apps/single-tenant-overview-compare

    In essence, for controlling costs with high usage or complex scenarios, the Standard plan is usually better due to fixed predictable billing and advanced capabilities. For flexible pay-per-use with low usage, Consumption plan is more cost-effective. The best choice depends on specific workload, action volume, and required features.

    I hope this information helps. If you have any further questions, please feel free to post them here. I am happy to assist you.

    Was this answer helpful?


  2. Marcin Policht 92,545 Reputation points MVP Volunteer Moderator
    2025-09-01T11:25:34.1366667+00:00

    Let's break it down for Logic Apps Standard vs Logic Apps Consumption since you mentioned Consumption plan FYI.

    Billing & usage in Logic App (Consumption)

    • In Consumption plan, billing is per action execution.
    • An action is any step (HTTP, Parse JSON, Condition, etc.) that runs inside the workflow.
    • A ForEach loop does not collapse the cost — instead, it runs the actions inside it separately for each iteration.

    Example with your case:

    • You have 3 actions inside the ForEach loop.
    • Loop runs 550 times.
    • Total action executions = 3 × 550 = 1650.
    • These 1650 will be metered and billed.

    Additionally:

    • The ForEach control action itself also counts as an action execution once per run.
    • So, the real total = 1650 + 1 = 1651 executions.

    Billing & usage in Logic App (Standard)

    • In Standard plan, pricing is different:
      • You pay for the compute/storage resources that host your Logic App (App Service Plan or Premium).
      • Actions are not metered individually for billing, but they do show up in metrics (executions, duration, failures).
      • So if you're concerned about billing, only Consumption requires per-action counting.

    If you're on Consumption and worried about costs:

    • Minimize actions inside loops (e.g., combine logic into a single Azure Function or inline code).
    • Use batching before the ForEach (process multiple items at once).
    • Be careful with Parse JSON — it counts as a full action execution. If possible, use @item()?['field'] instead of parsing.

    So, in Consumption plan, 3 actions inside the loop × 550 iterations = 1650 action executions, plus 1 for the ForEach = 1651 billable actions per run.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.