Flow exceeded maximum run duration – Flow took too long to complete based on platform limits

Loading

Power Automate enforces maximum execution time limits to ensure flows do not run indefinitely. If a flow takes too long to complete, it fails with the error:

“Flow exceeded maximum run duration.”

This guide explains:
Why this error occurs.
How to check and monitor flow execution time.
How to optimize your flow to complete within the allowed time limits.


Step 1: Understanding Maximum Run Duration Limits in Power Automate

1.1. Flow Execution Time Limits by Plan

Power Automate limits how long a single flow execution can run before it is automatically terminated.

Plan TypeMax Run Duration
Microsoft 365 Plan (Standard)30 minutes
Per-User Plan / Per-Flow Plan1 hour
Power Automate Process Plan5 hours
Azure Logic Apps (Alternative)Unlimited (with cost considerations)

If a flow runs longer than the allowed duration, it fails automatically.

1.2. Common Reasons for Exceeding Run Duration

Large Data Processing – The flow is processing too many items (e.g., large SharePoint lists, Dataverse tables, or Excel files).
Inefficient Loops (“Apply to Each”) – The flow is looping through thousands of records.
Delays in API Responses – Actions like HTTP requests, SQL queries, or SharePoint actions take too long.
Long Running Approvals – Flows waiting for an approval response may time out.
Nested and Complex Conditions – Multiple conditions and nested flows can slow down execution.
Too Many Actions in a Single Flow – A flow with hundreds of actions may take too long to execute.


Step 2: Identifying the Issue

2.1. Check Flow Run History for Duration

  1. Open Power Automate (https://make.powerautomate.com).
  2. Click on My Flows → Select the affected flow.
  3. Go to Run History → Open a failed run.
  4. Look for the error: The flow execution exceeded the maximum run duration allowed.

2.2. Check Execution Time of Each Action

  1. Expand each flow step.
  2. Look for long-running actions (e.g., an Excel action taking 25 minutes).
  3. Identify which step is delaying the flow.

Step 3: Resolving the Issue

3.1. Reduce the Number of Processed Items

If the flow processes large datasets, reduce the number of records per run.

Example: SharePoint Get Items – Retrieve Fewer Records

  • Instead of retrieving all items, use filter queries: Filter Query: Status eq 'Active'
  • Set Top Count to limit the number of retrieved items (e.g., 500).

Example: Dataverse List Rows – Use Pagination and Filtering

  • Enable pagination to retrieve only required data.
  • Set a row limit (e.g., 1000).

3.2. Optimize “Apply to Each” Loops

Loops processing thousands of records can slow down execution.

Limit Concurrency in Apply to Each

  1. Click on the Apply to Each action.
  2. Open Settings → Enable Concurrency Control.
  3. Set a lower parallel execution limit (e.g., 10).

This ensures faster execution without overloading the system.


3.3. Split Large Flows into Multiple Smaller Flows

If a flow handles too many tasks, break it into smaller, separate flows.

Example: Instead of One Flow Handling 10,000 Items, Use Multiple Scheduled Flows

  • Schedule Flow 1 to run at 8:00 AM (process first 5000 records).
  • Schedule Flow 2 to run at 9:00 AM (process next 5000 records).

This prevents long execution times while maintaining efficiency.


3.4. Avoid Long Running Delays and Approvals

Flows waiting for approval for a long time may exceed duration limits.

Solution: Use Parallel Approval Flows

  1. Instead of waiting indefinitely, configure timeout settings in approvals.
  2. Send reminders every X minutes instead of keeping the flow running.

3.5. Process Data in Batches Instead of All at Once

Instead of processing thousands of records in one go, batch them.

Example: Use Skip and Top to Process in Batches

  1. Retrieve only 1000 records per run.
  2. Use pagination to get the next 1000 records in the next run.

This prevents flow timeout errors.


3.6. Move Complex Logic to Azure Logic Apps

If a flow requires more than 5 hours, use Azure Logic Apps, which supports longer execution times.

  1. Open Azure Portal → Go to Logic Apps.
  2. Create a Logic App for long-running tasks.
  3. Trigger Power Automate flows from Logic Apps.

This ensures uninterrupted execution beyond Power Automate limits.


3.7. Upgrade to a Higher Power Automate Plan

If your flows regularly exceed run duration limits, consider upgrading.

  1. Open Microsoft 365 Admin Center (https://admin.microsoft.com).
  2. Navigate to BillingPurchase Services.
  3. Choose a Power Automate Per-User Plan or Per-Flow Plan.

Higher plans offer extended execution times.


Step 4: Preventing Future Run Duration Issues

4.1. Best Practices for Optimizing Flow Execution

Retrieve only required data – Use filtering and pagination.
Avoid processing large datasets in one execution – Use batching.
Reduce complex conditions – Use simple logic.
Use scheduled triggers instead of continuous triggers.
Monitor flow duration in Power Platform Admin Center – Identify slow steps.

4.2. Set Up Alerts for Long-Running Flows

  1. Open Power Platform Admin Center.
  2. Set up alerts for flows running longer than X minutes.

This helps detect slow flows before they fail.

Leave a Reply

Your email address will not be published. Required fields are marked *