Flow execution timed out – The flow’s execution time exceeded the service limits or resource restrictions.

Loading

1. Introduction

Power Automate enables users to automate workflows by connecting multiple services like SharePoint, SQL Server, Dynamics 365, and APIs. However, sometimes a flow may fail with the following error message:

“Flow execution timed out – The flow’s execution time exceeded the service limits or resource restrictions.”

This error indicates that the flow has exceeded its allowed execution time, leading to automatic termination. Understanding the reasons behind this error and how to troubleshoot it will help optimize the flow and ensure successful execution.


2. Causes of the “Flow Execution Timed Out” Error

The error occurs when a flow takes too long to execute due to one or more of the following reasons:

  1. Long-running loops or actions: Flows with too many iterations (e.g., Apply to each, Do until) may exceed time limits.
  2. API rate limits or slow responses: If a service (e.g., SharePoint, SQL Server, or an API) takes too long to respond, the flow may time out.
  3. Service plan limitations: Free or lower-tier Power Automate plans have shorter execution time limits.
  4. Inefficient data retrieval: Large datasets processed using Filter Query or Get items can slow down execution.
  5. Parallel executions causing congestion: Multiple instances of the same flow running simultaneously may consume excessive resources.
  6. On-Premise Data Gateway performance issues: If a flow uses the On-Premises Data Gateway, network latency or server load may cause delays.
  7. Infinite loops: A misconfigured flow may enter an infinite loop, continuously executing until the timeout occurs.
  8. Power Automate system restrictions: Power Automate has built-in execution time limits for different plans.

3. Power Automate Execution Time Limits

Power Automate enforces different execution time limits based on the plan:

Plan TypeExecution Time Limit
Free Plan5 minutes
Per User Plan30 minutes
Per Flow Plan30 minutes
Premium Plan30 minutes (extendable in Logic Apps)

If a flow exceeds these limits, it will time out automatically.


4. Step-by-Step Troubleshooting Guide

Step 1: Identify the Action Causing the Timeout

  1. Open Power Automate Portal (https://flow.microsoft.com).
  2. Go to My Flows and select the failed flow.
  3. Click on Run History and open a failed run.
  4. Identify the action where the timeout occurred (look for long execution times in the timeline).
  5. Note any error codes (e.g., 504 Gateway Timeout) that indicate a slow service response.

Step 2: Optimize Loops and Apply to Each Actions

  • If the flow contains an Apply to Each action:
    • Use pagination to reduce the number of iterations.
    • Limit the number of retrieved records using a Filter Query.
    • Consider using parallel processing to speed up execution.

Step 3: Optimize Data Retrieval (SharePoint, SQL, Dataverse)

  • If using Get Items (SharePoint List) or List Rows (Dataverse):
    • Add a Filter Query to reduce data size.
    • Enable pagination but set a reasonable limit (e.g., 5000 instead of 50,000).
    • Retrieve only necessary columns instead of entire records.

Example for SharePoint Get Items optimization:

Filter Query: Status eq 'Approved'
Top Count: 1000

Step 4: Reduce API Calls and Service Requests

  • If calling an external API, verify if the API has rate limits.
  • If making multiple API calls:
    • Reduce unnecessary requests.
    • Introduce Delay actions between requests.
    • Use batch processing instead of calling the API for each item.

Step 5: Use Parallelism to Speed Up Execution

  • Enable Concurrency Control for actions inside loops:
    1. Click on Apply to Each.
    2. Open Settings.
    3. Enable Concurrency Control and set an appropriate degree of parallelism (e.g., 5).

Step 6: Optimize On-Premise Data Gateway Performance

  • If connecting to on-premise data (SQL Server, SharePoint, etc.):
    • Ensure the On-Premise Data Gateway is running efficiently.
    • Check network latency and server load.
    • Reduce the volume of retrieved data.

Step 7: Avoid Infinite Loops

  • If using Do Until loops:
    • Set a maximum loop count.
    • Ensure exit conditions are correctly configured.

Example:

Do Until Condition: Counter > 10

Step 8: Increase Timeout Settings (For Premium Users)

  • Some actions allow increasing timeout settings:
    1. Click on the action in your flow.
    2. Open Settings.
    3. Increase the Timeout Duration (if available).

For example, in an HTTP action, set:

"timeout": "PT30M"

This extends the timeout to 30 minutes.


Step 9: Split Large Flows into Multiple Flows

  • If a single flow is too complex, break it into multiple flows:
    • Use child flows to split execution.
    • Trigger subflows using Power Automate HTTP request or Power Automate Cloud Flow Call.

Step 10: Upgrade Power Automate Plan (If Necessary)

  • If running on a Free or Per-User Plan, consider upgrading to:
    • Power Automate Per-Flow Plan for higher limits.
    • Logic Apps (Azure) for extended execution times beyond 30 minutes.

5. Preventative Measures

To minimize the chances of encountering the “Flow execution timed out” error in the future:

  • Monitor Flow Performance: Regularly check run history and optimize slow actions.
  • Use Efficient Queries: Filter data before retrieval to avoid large datasets.
  • Implement Concurrency Control: Enable parallelism for faster processing.
  • Use Retry Policies: Configure automatic retries for actions that may fail intermittently.
  • Keep Flow Simpler: Break complex flows into smaller subflows to avoid execution limits.

Leave a Reply

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