Flow Timeout

How often do you need to do something complicated in Power Apps and you use Flow to do this for you? Long running flows can cause problems.

When this something takes longer than a minute you might run into issues. These long running flows called from Power Apps will time out after one minute. The Power Platform can handle long running flows, however when you call them from Power Apps you might have to do some additional work.

During one of my projects I recently ran into the issue where the flows would sometimes take longer than 1 minute. Then as I tested the solution I also found that you get the same error when you close the app before the flow has finished.

Long running flows

As a test I created a flow that simply waits for 2 minutes and then I called it from a Button or a Timer in Power Apps and in both cases I received the following failure

Flow Timeout

The execution of template action ‘Respond_to_a_PowerApp_or_flow’ is failed: the client application timed out waiting for a response from service. This means that workflow took longer to respond than the alloted timeout value. The connection maintained between the client application and service will be closed and client application will get an HTTP status code 504 Gateway Timeout.

In my case I was able to optimise the flow a bit and the problem went away. Of course it doesn’t stop the user from closing the Power App. So you might need to add some error handling on the Respond to a PowerApp or flow action.

How to optimize your flows?

Improve your flow’s performance in a few easy steps

Use 1 Parse JSON action to validate data

Microsoft Flow – Single item nested arrays

1 Flow Performance tip to get your flows out of the stone age

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

16 thoughts on “Long running flows in Power Apps.”
    1. Hi Heli,

      In general flows shouldn’t run very long. Splitting up flows or using any of the optimization steps that I have blogged about should help.

      Can you give some details on what your flow is doing.

      I will include some links to Power Automate optimization posts in this post.

    1. Hi Joe,

      This is one of the reasons why in general RPA isn’t a great idea. It doesn’t give you the finer control that the classic flows give you. In general using APIs rather than RPA is quicker and more reliable.

  1. I have a JSON that has 1000+ rows. the ForEach is taking over an hour to update excel sheet. what can be done to speed this process up and respond before timing out in powerapps waiting for response.

  2. First Peter: Thank you for all your posts (very informative). If one gets to large of arrays to GRAPH there is a HTTP timeout issue that comes up on this. Thus how would one go about best splitting the data into decent sided batches.

  3. Hi Pieter,

    I received the same error, but the flow run time was only 10 seconds. Any idea what might have went wrong?

    Thank you.

    1. Hi Robin,

      I think that your flow is being kicked off by your ap, however the respond back tot he app action is never run. So your flow is finishing as there are now more steps to execute, but the app hasn’t received a response back yet.

  4. Hi Pieter ,
    There could be scenarios where the flow takes more then 3 minutes to complete e.g. if there is an on demand pull from API and ETL . Is there a way to handle long running flows ? you have only said “fix your flow to not take so long ” !! you have not told us if power app can handle long running flows

  5. The purpose of my flow is to retrieve the data from a source , apply some transformation and deliver to a sql tables and then upon success from the flow to pull that data in to the powerapp . The actions are on demand to ensure that the latest data is retrieved . For a long running flowing i am not seeing that we can capture a success status form the flow. Your suggestion is to execute a flow and leave it running and disconnect from it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.