One of those actions in Flow that I never use is the Terminate action. Ok, unless my clients really want flows to report their failures in the Power Automate UI. I’ve created a few example flows to explain why.

My flow checks my location and if the location is set to Milton Keynes then I’m setting a compose action and otherwise I’m ending my flow.

Microsoft Flow - Never terminate your flows unless you like failure Microsoft Flow clean end

I could include a terminate in the no branch of my condition.

Microsoft Flow - Never terminate your flows unless you like failure Microsoft Flow terminateflow

This will result in flows failing in the run history.

Microsoft Flow - Never terminate your flows unless you like failure Microsoft Flow runhistoryfailures

If this is what you want then no problem of course.I could even imagine that if you have implemented my try/catch pattern and you don’t like all flows succeeding then you could include a terminate in the catch part of the flow.  just after you sent an email to support or the person starting the flow.

When you run your main process flow ‘code’ however there isn’t really a need to terminate your flows.  Imagines having multiple parallel branches in your flow and multiple locations have terminate steps. You now don’t know which terminate will run first and your process becomes unpredictable.

Parallel Terminate steps

One other reason I’ve seen people use terminate is a need to stop a pending approval process. This is another one of these circumstances where terminate doesn’t really give you the right solution as the Start Approval action is still pending while the flow has already failed. If there were any actions following the terminated approval action they would not run. So your users may have the feeling that they responded, however the flow will not run the process as a user may expect.

Microsoft Flow - Never terminate your flows unless you like failure Microsoft Flow pending

Microsoft Flow - Never terminate your flows unless you like failure Microsoft Flow approvaloutstanding

 

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

8 thoughts on “Microsoft Flow – Never terminate your flows unless you like failure”
  1. Hey Pieter,
    Can you please write an updated blog on the Terminate action? Flow ahs updated since you wrote this and you can now set the status of the flow in the terminate action. I need clarity on this action!
    Thanks for the awesome content!

      1. Okay got it. I’m looking into because I need a way to stop a scheduled recurring flow. I don’t see a way of tracking if a flow instance is ‘waiting’ to execute and how to stop it from running.

      2. The scheduled flow creates a new run each time it repeats – it’s not one instance that holds all recurring runs. So I need to stop the recurrence for a specific instance. I don’t want to turn off the flow (unless turning it off and then on will achieve my goal…?)

      3. Ok, so that sounds like you have a scheduled flow that runs every 2 minutes or so. Then the flows potentially run for 10 minutes and you have multiple runs.

        A bit like I described in this post:
        https://sharepains.com/2021/04/01/many-running-flows-in-power-automate/

        You can avoid this either by the method that I mentioned in the post, so that logic controls the number of instances running at any one time. Or you could maybe even just only let one flow run by changing the settings in the settings of the trigger.

      4. Yeah, I need just one instance running. But for that one, how can I stop it if needed? It runs recurrently in separate instances; it is not in a pausing stage or anything. The only idea I have is to edit the flow to make it end manually.

Leave a Reply

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

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading