Processing tens of thousands of records in a single Power Automate flow is a recipe for hitting action limits, timeouts, and throttling errors. This lesson teaches you how to design a production-grade fan-out architecture using child flows — splitting large datasets into controlled batches, running them in parallel, and aggregating results back in the orchestrator without race conditions or data loss.

Picture this: your organization needs to process 50,000 invoice records nightly — validating each one against an ERP, enriching it with supplier data, and writing the result to Dataverse. You build a single cloud flow with an Apply to Each loop. It runs. Slowly. After six hours, it hits the 30-day action limit and dies. You've just rediscovered one of Power Automate's most common production failure modes.
The fan-out pattern solves this problem elegantly. Rather than processing records sequentially in one monolithic flow, you split your dataset into batches, dispatch each batch to a child flow running independently, collect the results, and aggregate them back in the orchestrator. The whole operation runs in parallel, finishes in a fraction of the time, and stays well inside platform limits — if you design it correctly. The word "if" is doing a lot of work in that sentence, which is why this lesson exists.
By the end of this article, you'll be able to design and build a production-grade fan-out architecture in Power Automate: splitting records into appropriately sized batches, invoking child flows with controlled concurrency, designing the child flows to do real work and return structured results, and aggregating those results back in the orchestrator without race conditions or data loss. We'll also walk through the limits you need to design around, the mistakes that will bite you in production, and a complete hands-on exercise you can adapt immediately.
What you'll learn:
This lesson assumes you're comfortable with the fundamentals of Power Automate cloud flows and have already worked with child flows at a basic level. You should understand Apply to Each, variables, and expressions. Familiarity with orchestrating child flows and scoped execution will be particularly helpful. You should also have a working understanding of parallel branching and concurrency control — we'll build on those concepts heavily here.
A Power Automate Premium license (per-flow or per-user) is required, since child flow invocation requires the Power Automate Premium connector.
Before you write a single action, you need to understand the constraint landscape. Building this architecture without that knowledge is like designing a bridge without knowing the load limits.
Action limits per flow run. A single Power Automate cloud flow run is capped at 100,000 actions for flows with premium connectors. This sounds generous until you realize that every iteration of an Apply to Each counts as actions, as does every connector call within it. Processing 10,000 records with 8 actions each = 80,000 actions. Add pagination, error handling, and retry logic and you're over the limit before you've finished.
Concurrency limits on Apply to Each. The Apply to Each action allows a maximum concurrency degree of 50. This is the number of iterations that can run simultaneously. It sounds like it should be enough, but when each iteration is itself invoking a child flow that makes external API calls, you're not just managing concurrency in the loop — you're generating a cascade of outbound requests that can overwhelm downstream systems.
Throughput limits for child flow invocations. Power Automate Premium connector calls are subject to the per-user or per-flow API request limits defined in your licensing tier. Refer to the capacity and API request limits guide for the exact numbers, but the practical implication is: if you fan out to 500 child flows simultaneously, you will exceed your request allocation and trigger throttling.
Concurrency on the child flow's trigger side. Child flows invoked via "Run a Child Flow" have their own concurrency setting on their trigger. If you leave this at the default of 1, every invocation queues behind the previous one — completely defeating the purpose of fan-out. If you set it too high, you risk overwhelming the connections inside the child flow.
The 30-day run timeout. Each flow run has a maximum duration of 30 days, but practically, long-running orchestrators (over 12 hours) are a liability. Fan-out dramatically reduces wall-clock time, which makes this limit irrelevant in well-designed systems.
Key insight
The fan-out pattern doesn't just make things faster — it fundamentally restructures where the work happens. The orchestrator becomes lightweight coordination logic. The heavy lifting moves into child flows, each of which has its own independent action counter and run timeout. This is the core of why the pattern works.
The fan-out pattern has three distinct layers:
The Orchestrator Flow — triggered by a schedule or event, it fetches the full record set, splits it into batches, invokes child flows in parallel (with controlled concurrency), collects results, and writes the final aggregated outcome.
The Worker Child Flow — receives a batch of records as input, processes each one (calling APIs, writing to Dataverse, transforming data), and returns a structured result object containing success counts, failure counts, and optionally a list of failed record IDs.
The Aggregation Step — back in the orchestrator, results from all child flows are merged into a coherent summary, failed records are routed to a dead-letter store or retry queue, and telemetry is emitted.
Let's build each layer properly.
Your orchestrator starts by retrieving the records to process. For our invoice processing example, imagine you're querying Dataverse for all invoices with status "PendingValidation."
You'll use a List Rows action against the Invoices table with a filter of statuscode eq 1 (Pending). But a naive list action will return at most 5,000 rows without pagination. For 50,000 records, you need to handle pagination properly — the pagination and throttling guide covers this in depth.
Once you have the full array of records, you need to split it into chunks. Power Automate has no native "chunk array" function, so you'll implement it with a Do Until loop. Here's the expression logic:
// Initialize these variables before the chunking loop:
// - varAllRecords: array (your full record set from Dataverse)
// - varChunkSize: integer (set to 200)
// - varChunks: array (starts empty — will hold your batch arrays)
// - varOffset: integer (starts at 0)
// Inside a Do Until loop (condition: varOffset >= length(varAllRecords)):
// Append to varChunks:
skip(take(varAllRecords, add(variables('varOffset'), variables('varChunkSize'))), variables('varOffset'))
// Then increment varOffset:
add(variables('varOffset'), variables('varChunkSize'))
This produces an array of arrays — each inner array is one batch of up to 200 invoice records. The chunk size of 200 is deliberate: it's small enough that each child flow run completes well under the action limit, and large enough that you're not creating thousands of child flow invocations.
Tip
Calculate your chunk size based on the number of actions per record in your child flow. If processing one record takes 6 actions (get, transform, write, log), and your child flow has overhead of ~50 actions, then 200 records × 6 = 1,200 + 50 = 1,250 actions per child run — comfortably inside the 100,000 action limit and fast enough to complete in minutes.
For 50,000 records at 200 per chunk, you'll produce 250 chunks. This means 250 child flow invocations from the orchestrator. Keep that number in mind as we design the controlled dispatch.
Here's where many implementations go wrong. Developers configure the Apply to Each (which iterates over varChunks) with maximum concurrency of 50, run all 250 invocations, and wonder why they're getting throttling errors an hour later. The problem is they haven't thought about the downstream pressure.
The right approach is to set concurrency on Apply to Each to a value that reflects your actual throughput budget. A safe starting point for most licensed tenants is 10–15 concurrent child flow invocations. This isn't arbitrary — it's based on the typical API request budget and the latency of child flow startup.
Configure Apply to Each concurrency:
Each iteration of this loop does exactly one thing: invoke the child flow with the current batch.
// Apply to Each iterates over: varChunks
// Action: Run a Child Flow
// Flow: "Invoice Processor Worker"
// Inputs:
// recordBatch: items('Apply_to_each_Chunks') <- the current batch array
// batchIndex: iterationIndexes('Apply_to_each_Chunks')
// correlationId: variables('varCorrelationId')
Passing batchIndex to the child flow is important — it makes debugging vastly easier because you can correlate log entries back to a specific batch. The correlationId is a GUID you generate at the start of the orchestrator run (using guid()) and pass through to every child flow and every log entry. This is the backbone of distributed tracing across child flows.
After the Apply to Each completes (all child flows have returned), you need to aggregate the results. Each child flow invocation returns a JSON object via its Response action. You collect these using an array variable that you append to inside the Apply to Each.
Warning
If your Apply to Each is running with concurrency > 1, you cannot safely append to an array variable from inside the loop without risk of concurrent writes overwriting each other. This is a classic race condition. The workaround: use the outputs of the Apply to Each action itself after the loop completes, rather than accumulating during iteration.
Here's how to collect results safely after the loop:
// After Apply to Each completes, use this expression to get all outputs:
outputs('Apply_to_each_Chunks')
// But the safer, more structured approach is to reference the body of
// the Run Child Flow action across all iterations:
body('Run_a_Child_Flow')
The cleaner production pattern is to use a Select action after the Apply to Each to project the result bodies into a clean array:
// Select action:
// From: outputs('Apply_to_each_Chunks')?['value'] <- all iteration outputs
// Map:
// successCount: item()?['body']?['successCount']
// failureCount: item()?['body']?['failureCount']
// failedRecordIds: item()?['body']?['failedRecordIds']
// batchIndex: item()?['body']?['batchIndex']
Then use two Compose actions to calculate total successes and failures:
// Total successes:
sum(body('Select_Results')?[*]['successCount'])
// Total failures:
sum(body('Select_Results')?[*]['failureCount'])
The worker child flow is where the real processing happens. Getting its design right is what separates a fragile proof-of-concept from a production system.
Define the child flow's inputs explicitly in the trigger. Navigate to the "Manually trigger a flow" or use the HTTP trigger approach — but for child flow invocation via the Power Automate Premium connector's "Run a Child Flow" action, the trigger must be "Manually trigger a flow" with clearly defined input fields.
Add these inputs to the trigger:
recordBatch — type: Text (you'll pass a JSON string of the batch array and parse it inside the child flow)batchIndex — type: NumbercorrelationId — type: TextNote
Power Automate's "Run a Child Flow" action doesn't natively support passing arrays as structured inputs — it transmits everything as text. So serialize your batch array to JSON in the orchestrator (string(items('Apply_to_each_Chunks'))) and deserialize it at the top of the child flow using a Parse JSON action.
The output schema (defined in the Response action at the end of the child flow) should be:
{
"type": "object",
"properties": {
"batchIndex": { "type": "integer" },
"successCount": { "type": "integer" },
"failureCount": { "type": "integer" },
"failedRecordIds": {
"type": "array",
"items": { "type": "string" }
},
"processingDurationMs": { "type": "integer" },
"correlationId": { "type": "string" }
}
}
After parsing the input batch, the child flow iterates over its records. Here's where you must resist the temptation to nest another Apply to Each with high concurrency. The child flow's Apply to Each should run sequentially (concurrency = 1) or with modest concurrency (5–10), depending on the downstream system's capacity.
For each invoice record, the child flow:
Critically, each of these steps needs error handling. Configure each connector action with "Configure run after" so that failures are caught rather than propagating to terminate the child flow:
For each record's processing scope (use a Scope action to group the 4 steps above), configure the Scope's run-after to include "has failed" and "has timed out." Then, in the failure branch:
// In the failure handler scope:
// Append to varFailedRecordIds:
triggerBody()?['recordBatch']?[variables('varCurrentIndex')]?['invoiceid']
// Increment varFailureCount by 1
This is the key to partial failure handling: a child flow should never fail completely because one record is bad. It should process as many records as it can, collect the IDs of the ones it couldn't process, and report all of this back to the orchestrator.
Key insight
Child flows in a fan-out architecture should almost always succeed as a unit, even if individual records within the batch fail. If a child flow itself fails (throws an unhandled error), the orchestrator's Apply to Each will treat it as a failed iteration — and you'll lose visibility into which records in that batch succeeded and which didn't. Defensive processing inside child flows is non-negotiable in production.
When your child flow makes HTTP calls to external APIs, it will eventually hit rate limits — especially under parallel load. Build exponential backoff and retry logic into the HTTP actions using the built-in retry policy. For standard connector actions (like Dataverse), configure retry policy in the action settings:
For custom HTTP actions calling your ERP, configure this in the action's settings panel under "Retry Policy."
At the very end of the child flow — after the Apply to Each loop over records and after the failure-handling logic — add a Response action that returns the aggregated results:
{
"batchIndex": @{triggerBody()?['batchIndex']},
"successCount": @{variables('varSuccessCount')},
"failureCount": @{variables('varFailureCount')},
"failedRecordIds": @{variables('varFailedRecordIds')},
"processingDurationMs": @{sub(ticks(utcNow()), variables('varStartTicks'))},
"correlationId": @{triggerBody()?['correlationId']}
}
Warning
If you don't add a Response action to the child flow, the "Run a Child Flow" action in the orchestrator will return successfully but with an empty body. You'll have no results to aggregate. Always test child flow responses explicitly before wiring them into the orchestrator.
Back in the orchestrator, after all child flows have returned, you have a complete picture of what happened. Now you need to act on it.
The failedRecordIds arrays from each child flow batch should be unioned into a single list. Use an Apply to Each over your results array, appending each child flow's failedRecordIds array into a master varAllFailedRecordIds variable (this is safe now because we're sequential at this point, not inside a concurrent loop):
// Apply to Each over: body('Select_Results')
// Append to varAllFailedRecordIds:
union(variables('varAllFailedRecordIds'), item()?['failedRecordIds'])
Failed records should be written to a dead-letter store — a Dataverse table, an Azure Service Bus dead-letter queue, or a SharePoint list depending on your architecture. The dead-letter queue handling pattern gives you the full playbook for building reprocessing capability.
Every production orchestrator should emit a summary telemetry event. This becomes the heartbeat signal that your operations team uses to monitor the nightly run. Use an HTTP action to send to Application Insights:
{
"name": "InvoiceProcessingRun",
"properties": {
"correlationId": "@{variables('varCorrelationId')}",
"totalRecords": "@{length(variables('varAllRecords'))}",
"totalBatches": "@{length(variables('varChunks'))}",
"successCount": "@{outputs('Compose_TotalSuccesses')}",
"failureCount": "@{outputs('Compose_TotalFailures')}",
"runDurationMs": "@{sub(ticks(utcNow()), variables('varOrchestratorStartTicks'))}",
"environment": "@{variables('varEnvironmentName')}"
}
}
For a complete monitoring architecture built on Application Insights, see building a Power Automate monitoring and alerting system.
This is the detail that most tutorials skip entirely, and it's the reason many fan-out implementations don't perform as expected.
Navigate to your worker child flow. Click on the trigger action ("Manually trigger a flow"). Open its Settings panel. You'll see "Concurrency Control." Enable it and set the degree to match the concurrency you configured on the orchestrator's Apply to Each.
If the orchestrator fans out at concurrency 10, set the child flow trigger concurrency to 10 or slightly higher (12–15) to absorb any burst. If you leave it at the default of 1 (or unconfigured, which also means 1), every child flow invocation queues — and your 10-way fan-out becomes sequential.
Tip
When you first deploy this architecture, temporarily set the child flow concurrency to 1 and run a small test dataset (5 batches). This makes the execution trace much easier to read in the flow run history. Once you've verified correctness, increase concurrency to production levels.
Both the orchestrator and child flows must live in the same Power Platform solution, and they should be packaged together for environment promotion. The child flow needs to be shared with the service principal or user account that the orchestrator's connection runs under. If the orchestrator can't "see" the child flow as a runnable flow, the "Run a Child Flow" action dropdown simply won't list it.
For ALM-safe environment promotion, see deploying and managing Power Automate solutions across environments. The key point is that environment variables should drive any configuration that changes between dev, test, and prod — including chunk sizes, concurrency degrees, and API endpoints.
Let's work through the math for a realistic scenario so you can apply this to your own workload.
Scenario: 50,000 invoice records, 6 actions per record in the child flow, 50 actions of overhead per child flow run.
Chunk size: 200 records → (200 × 6) + 50 = 1,250 actions per child flow run. ✅ Well under 100,000.
Number of batches: 50,000 / 200 = 250 batches.
Orchestrator actions: 250 iterations × ~5 actions per iteration (invoke + result handling) = 1,250 orchestrator actions. ✅ Fine.
Concurrency: Set to 10. At any moment, 10 child flows run simultaneously. Each child flow processes 200 records. That's 2,000 records being processed in parallel.
Estimated runtime: If each child flow takes 3 minutes to process 200 records (sequential within child, 6 API calls per record × 1.5s average latency = 9 minutes... hmm). Actually let's enable concurrency of 5 within the child's Apply to Each: 200 records / 5 concurrent = 40 iterations, each taking 1.5s × 6 API calls = 9s → 40 × 9s = 360 seconds = 6 minutes per child. With 10 concurrent child flows and 250 total: (250/10) × 6 minutes = 150 minutes. Under 3 hours for 50,000 records. Compare to sequential: 50,000 × 6 × 1.5s = 125 hours.
API request consumption: 250 child flows × 1,250 actions = 312,500 API requests. At the per-flow licensing level (250,000 API requests per day), you'd be over. This is where you either upgrade licensing, reduce the action count per record, or spread the run across multiple nights. Always calculate this before you deploy.
Build this end-to-end system to process a batch of invoice records from a Dataverse table.
Create a table called "Invoice" with these columns:
invoiceid (primary key, auto-generated)invoicenumber (text)supplierId (text)amount (decimal)statuscode (choice: PendingValidation, Validated, Failed)Populate it with at least 500 test rows (use a one-time flow with an Apply to Each over a manually constructed array to seed the data).
recordBatch (text), batchIndex (number), correlationId (text)triggerBody()?['recordBatch']varSuccessCount (integer, 0), varFailureCount (integer, 0), varFailedRecordIds (array, [])mod(indexOf(variables('varAllIds'), item()?['invoiceid']), 20) equals 0), then update the Dataverse row's statuscodevarFailedRecordIds and increment varFailureCountvarSuccessCountvarAllRecords (array, the list rows value), varChunks (array, []), varOffset (integer, 0), varCorrelationId (string, guid())greaterOrEquals(variables('varOffset'), length(variables('varAllRecords'))))skip(take(...)), append to varChunks, increment varOffset by chunk size (200)varChunks, concurrency 10Run the orchestrator with 500 test records (3 batches of ~167 each at the default configuration). Check:
Mistake: Child flow doesn't appear in the "Run a Child Flow" dropdown. Both flows must be in the same solution, the child flow must have a "Manually trigger a flow" trigger, and it must be shared with the connection account used by the orchestrator. Also verify the child flow is turned ON — a disabled flow won't appear.
Mistake: Results from child flows are all null. You forgot to add a Response action to the child flow, or the Response action fires before the processing loop completes (it was placed inside the loop). The Response action must be the final action in the child flow's top-level sequence, after the Apply to Each.
Mistake: Race condition on the results variable. You're appending to a variable inside a concurrent Apply to Each. Never do this. Collect results after the loop using the action outputs approach described earlier.
Mistake: Some child flows run sequentially even with concurrency configured. The child flow's trigger concurrency hasn't been configured. This is a separate setting from the orchestrator's Apply to Each concurrency. Set it on the child flow's trigger.
Mistake: Throttling errors appearing 20–30 minutes into the run. Your API request allocation is being exhausted. Reduce Apply to Each concurrency in the orchestrator, or increase your licensing tier. Use the flow run quotas monitoring approach to get real-time visibility into consumption.
Mistake: Child flows time out for large batches. Reduce chunk size. If your child flow is taking over 30 minutes per batch, reduce to 100 or 50 records per batch. The goal is child runs completing in under 10 minutes — this gives you comfortable headroom and faster feedback on failures.
Mistake: The orchestrator runs fine in dev but fails in production due to DLP policies. The Power Automate Premium connector (used for child flow invocation) must be in the Business data group in your DLP policy. If it's in the Non-Business or Blocked group in production, the orchestrator will fail immediately. See configuring DLP policies for enterprise cloud flows to get this right before promoting solutions.
Warning
Be careful about deploying this pattern to environments where you don't control the DLP policy. If the Power Automate connector moves to Blocked (which some overly restrictive policies do), every child flow invocation will fail. Always validate DLP compatibility as part of your pre-deployment checklist.
Fan-out with child flows is powerful, but it's not always the right tool.
Use fan-out child flows when:
Consider batching and chunking within a single flow instead when:
Consider Azure Service Bus with event-driven processing when:
Consider Azure Functions for compute-heavy workloads when:
You now have a complete blueprint for fan-out processing in Power Automate. The pattern's power comes from understanding the interaction between orchestrator concurrency, child flow trigger concurrency, action limit budgets per run, and API request consumption — and designing each layer to operate safely within those constraints.
The key design decisions to revisit for your specific workload:
For next steps, build out the monitoring layer using correlation IDs passed through the fan-out chain, and configure alerting when failure rates exceed a threshold. Then work through the ALM promotion process to move this pattern from dev to production safely — environment variables for chunk size and concurrency are essential so you can tune settings per environment without code changes.