top of page

Scaling Power Automate, Part 3: Throttling, Retries, and Designing for Partial Failure

Writer: Ed G.
Ed G.
1 hour ago
6 min read

This is Part 3 of a three-part series on scaling Power Automate flows that process thousands of Dataverse records. Part 1 covered batching and Do Until traps. Part 2 covered concurrency, run history, and the virtual-table N+1 problem.

Quick recap: the sync flow now batches correctly, keeps moving past bad records, runs five iterations in parallel, and makes one virtual-table lookup per contact instead of three. Processing went from close to four hours for a couple thousand records to about an hour for 4,000. This last part is about making that hold up in production: throttling, retries, and accepting that some records will always fail.

Same labels as before: Documented is Microsoft-documented behavior, Observed is what I saw in this implementation, and Recommendation is what I'd do based on both.


Handling throttling and HTTP 429

Concurrency improved performance, but a different flow showed its limits. Observed: a virtual-table List rows call occasionally returned:

HTTP 429 Too Many Requests
Rate limit is exceeded. Try again in 20 seconds.

The trace pointed at API Management and external connector components. Turning up parallelism doesn't make the downstream service any bigger; it just sends it more traffic at once.

There are two different concurrency settings, and it's worth being precise about them:

Setting

Where

What it controls

Apply to each concurrency

Loop settings

Parallel iterations inside one flow run

Trigger concurrency control

Trigger settings

How many runs of the whole flow execute at once

For the big sync loop, concurrency 5 was a reasonable starting point. The flow that hit 429s was different: it was event-triggered on Dataverse row creation, and it made its own identity-table calls. That sets up a thundering herd:

300 rows created in a bulk import
→ up to 300 flow runs triggered almost at once
→ each one queries the identity virtual table
→ API Management rate limiting kicks in
→ HTTP 429s

The mitigation was to turn on Concurrency Control on the Dataverse trigger with a conservative limit (starting around 2) and to give the identity List rows action a retry policy suited to transient 429s (next section).

Before you do this, know what Microsoft documents about trigger concurrency:

  • It's off by default, and when on it can be set from 1 to 100.

  • Turning it on can't be undone without deleting and re-adding the trigger.

  • When all concurrent slots are busy, only 10 plus the degree of parallelism runs can wait in the queue. With a limit of 2, that's 12. Triggers that arrive beyond that may be retried by the connector, but those retries might not succeed if the queue stays full for a long time.

That last point matters for the 300-row scenario: a limit of 2 trades 429s for a very short queue. Recommendation: test it with a realistic bulk volume and reconcile rows created against flow runs started. If they don't match, change the shape instead: have the event-triggered flow do almost nothing (for example, flag the row as "identity sync pending") and let a scheduled batch flow sweep the flagged rows at a controlled pace.


Retrying transient failures

Observed: besides 429s, the virtual table path occasionally threw external-provider stream failures. The pattern was thousands of successful calls and a handful of failures, which is very different from a query that fails every time.

That difference should drive the design:

  • Transient failures (429s, timeouts, a dropped stream) usually succeed if you wait and try again. Retry them.

  • Deterministic failures (malformed email, missing record, value too long) fail the same way every time. Retrying just burns time and actions. Log them and move on.

Documented: most connector actions default to an exponential retry policy of up to 4 retries at intervals between about 5 and 45 seconds. You can change this per action under Settings > Retry policy (none, fixed, or exponential). Retries count toward your request limits.

Recommendation: for a rate-limited dependency, give the specific action a custom exponential policy with more patience than the default. As a starting point (tune it for your own service): Count 6, Interval PT10S, Minimum interval PT10S, Maximum interval PT2M. Don't blanket every action with aggressive retries. With concurrency 5, every retry policy is multiplied by 5 lanes of traffic hitting the same throttled service.


Designing for partial failure

This became the biggest lesson of the whole project. For a sync job of 8,000+ records, the goal shouldn't be:

Every single record succeeds, or the entire job fails.

A better model is usually:

Process every record possible, capture the exceptions, and deal with the exceptions separately.

One bad email address should never stop the next 4,000-record batch.

Here's the per-record pattern inside the loop:

Apply to each: Current Batch   (concurrency 5)
├─ Scope: Try
│  ├─ List rows: Identity employee   (Filter rows, Select columns, Row count 1, custom retry)
│  ├─ Compose: values to write
│  └─ Update a row: Contact Profile
└─ Scope: Catch   (Configure run after on Try: has failed, has timed out)
   ├─ Filter array: result('Try') where status = Failed
   └─ Add a new row: Sync Exception

The Filter array takes result('Try') as its input with this condition:

@equals(item()?['status'], 'Failed')

The Sync Exception row captures the contact ID, the failing action's name, the error message from the filtered result, and the run ID (workflow()?['run']?['name']) so you can jump straight to the run.

A few design points:

  • Because Catch handles the error, the iteration succeeds, the Apply to each succeeds, and the Increment from Part 1 runs normally. The run-after change on Increment becomes the backstop, not the main defense.

  • Log to a table, not a variable. Appending to an array variable inside a concurrent loop is exactly the shared-state problem from Part 2.

  • Make updates idempotent. If re-running a record just sets the same values again, you can safely reprocess exceptions (or the whole batch) without side effects.

  • Don't let caught errors go silent. Once Catch swallows failures, the run shows green. At the end, count this run's Sync Exception rows and send a summary. I'd rather have a successful run that says "8,812 updated, 7 exceptions, here they are" than a failed run that buries 8,812 good updates. If exceptions exceed a threshold you choose, Terminate as Failed so someone looks.

  • Guard the loop exit (from Part 1) so a timeout can never pass for completion.


The final architecture

Putting the whole series together:

Trigger (scheduled)
├─ List rows: Contact Profile   (pagination on, Select columns)
├─ Compose: Total Rows
├─ Initialize varBatchStart = 0, varBatchSize = 4000
├─ Do Until varBatchStart >= Total Rows   (Count 60, Timeout PT6H)
│  ├─ Compose: Current Batch   (take/skip)
│  ├─ Apply to each: Current Batch   (concurrency 5, no variables inside)
│  │  ├─ Scope: Try   (one identity lookup, Compose, Update a row)
│  │  └─ Scope: Catch   (log Sync Exception row)
│  └─ Increment varBatchStart   (run after: succeeded, failed, timed out)
├─ Condition: varBatchStart < Total Rows? → Terminate (Failed, "loop exited early")
└─ Summary: count Sync Exceptions for this run → notify

And separately, for event-triggered flows that call the identity table: trigger concurrency on and conservative, a lightweight design when bulk creates are possible, and a patient retry policy on the lookup.

Here's what changed, from this implementation (Observed, not benchmarks):

Before

After

Identity virtual-table calls per contact

Up to 3

1

Variables inside the loop

Yes

No

Apply to each concurrency

1

5

Runtime

~2,000–2,500 records in close to 4 hours

~4,000 production records in about 1 hour

Do Until timeout

PT1H (batch 2 never ran)

PT6H, plus an exit guard

One bad record

Repeated the batch until timeout

Logged, loop moves on


Practical checklist

What I'd check on any flow that's about to handle thousands of records:

  • List rows pagination is on and the threshold covers your real volume (and you know your performance profile's limit).

  • Do Until Timeout is sized for the whole job, not one iteration. Count has headroom.

  • A guard after the Do Until fails the run if it exited before processing everything.

  • The progress pointer moves forward even when a batch partially fails (run after: succeeded, failed, timed out).

  • No Set/Increment/Append variable actions inside any loop you run concurrently.

  • You've measured action durations in run history before optimizing anything.

  • Lookups against external or virtual tables use Filter rows, Select columns, and Row count 1, and the filtered columns are indexed at the source.

  • No N+1 lookups: related values are joined where the data lives, not fetched one by one in the loop.

  • Concurrency is set deliberately, at both the loop and the trigger, with the downstream service's limits in mind.

  • Rate-limited actions have a retry policy tuned for transient failures.

  • Per-record Try/Catch scopes log exceptions to a table, and updates are idempotent.

  • Every run ends with a summary, so caught errors don't disappear.

When Power Automate starts processing thousands of records, optimization becomes less about individual actions and more about architecture. None of this is the only way to do it, though. If you've solved the same problems with child flows, queues, or something else entirely, I'd genuinely like to hear about it. I hope this helps someone out there staring at a four-hour run history.

Try. Fail. Learn. Repeat.


References

Comments

Rated 0 out of 5 stars.
No ratings yet

Commenting on this post isn't available anymore. Contact the site owner for more info.

©2018 by The Flying Polymath.

bottom of page