web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Terminate current flow...
Power Automate
Unanswered

Terminate current flow instance?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Guys, 

 

Apologies if this is an obvious question, but I'm new to flow and having come from a Nintex designer background I'm struggling to understand how to do a relatively simple thing in Flow

 

In short, I'm trying to terminate the current flow instance if the outcome of an approval is denied/rejected and continue with remainder actions if approved. 

 

I have found the "Terminate" and "Stop a flow" action but the terminate action cannot be added into a condition within a "for each" loop (where it needs to be") and the "Stop Flow" action isn't clear whether it will it just end the current flow instance??? 

 

Can anybody advise the best approach to solve this? 

 

Cheers

Simon

Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    Can you post a screen shot of your Flow?

     

    Can you explain why the terminate action needs to be inside of a loop?  Can just use an if statement between your approval actions an use a terminate action at that point.

     

    Approval1.jpg

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @ScottShearer

     

    Well, I dont actually need the loop at all, but I insert the Forms ""Get response details" action, Flow automatically applies the loop and I can't find a way to stop it from doing it? Therefore ideally I need a way to stop the flow inside the loop

     

    Capture1.PNG

    Capture2.PNG

    This is a screenshot of my Flow, id like to add in another level before the existing one (shown by red tick in screenshot) which if approved the flow continues,  if denied the flow is terminated. Do you know of a way I could achieve that from inside the loop? 

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    Have you tried this:

    • Insert an approval where you have the red check mark
    • Have an If statement following the approval
      • If response = Approve
        • start another approval
        • Continue Flow logic
      • If response Not equal Approve
        • Do nothing and the Flow ends

    So, everything after the first approval (including the second approval) would be inside of the If statement branch for Response = Approve

     

    Will this work for you?

     

    If this needs more explanation, please post here and I will provide screen shots of an example.

     

    Scott

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That certainly sounds like a possible solution. I did, however, forget to mention a critical step. Initially, I would like to a IF statement to check for a particular value. If the value equals TRUE then the Tier 1 approval is started, IF the value equals FALSE then the flow SKIPS  the Tier 1 approval and continues with the remainder actions in the flow. 

     

    Here is a rather crude drawing of what I am trying to achieve. Quite possibly a lack of understanding on my part but i would like to understand what would happen in the section marked "SKIP" in the screenshot. Would the Flow stop? or would it continue to the remainder actions? (In Nitnex, this would skip and continue, which is possibly where I am going wrong)

     

    If the flow stops my guess is that i would need to repeat the actions in each branch to get the outcome I would like? 

     

    Capture3.PNG

     

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    If your Flow hit the "Skip" part of your logic/condition, it would then move on to the second Approval action.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ah ok great, thanks for confirming. So I guess the section marked "End"  in its current state would also continue to the second approval action also?. 😞

     

    If that's the case then I guess the question remains, how could I terminate the flow at the point marked "End" in the screenshot??

     

    I notice the "End Flow" action is available but I don't know if that's the right solution or if that action applies only to the current instance or to all instances?

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    One option might be to set a variable in the section of your Flow marked "end".  You'll need to initialize the variable somewhere at the top of the Flow (not inside of the loop).

    Directly abouve the second Approval action, insert an If statement and termintate the Flow if the variable is set to the appropriate value.  Otherwise, the Flow will continue.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Could you please share a screenshot of your flow's configuration?

     

    I have made a test and the issue is confirmed on my side. The "Terminate" action could not be used within a "Apply to each" action in Microsoft Flow currently. 

     

    If you want to use the "Terminate" action within a "Apply to each" action, I afraid that there is no way to achieve your needs in Microsoft Flow. If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    In addition, the "Stop a flow" action is used to disable a flow rather than terminate current flow. If a flow is in enable state, we could use the "Stop a flow" action to disable this flow.

     

    I agree with @ScottShearer's thought almost, you could consider take a try to initialize a variable at top of your flow (not within the "Apply to each" action), the default value set to false. Within the section of your flow marked "End", add a "Set variable" action to update the value of above variable to true. Then directly above the "Second Approval action", add a Condition to check if the variable is true, if yes, do nothing.

     

    Best regards,

    Kris

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Guys, 

     

    Just been doing some testing with the proposed solution (Thank you by the way :)) I have intialized the variable at the top of workflow with the TRUE value and I am attempting to set to FALSE when the Tier 1 Review is denied.

     

    Here is the test outcome... (Looks like the Set variable action is skipping for some reason?)



    FlowTest1.PNG

     

    Here is the flow configuration

     

    FlowTest2.PNG

     

    Have i made a mistake or misundertood here? Any help much appreciated 🙂 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Guys, 

     

    Just been doing some testing with the proposed solution (Thank you by the way :)) I have intialized the variable at the top of workflow with the TRUE value and I am attempting to set to FALSE when the Tier 1 Review is denied.

     

    Here is the test outcome... (Looks like the Set variable action is skipping for some reason?)



    FlowTest1.PNG

     

    Here is the flow configuration

     

    FlowTest2.PNG

     

    Have i made a mistake or misundertood here? Any help much appreciated 🙂 

     

    Thanks

    Simon

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard