Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to cancel a flow but not have it listed as 'Failed'

(2) ShareShare
ReportReport
Posted on by 27
Hi guys, 
 
Our main approval flows are setup so the approval times out after 3 days. After the approval times out, there's a sharepoint update item action set to run on timeout of the approval action. The sharepoint action updates a 'StartWF' variable to YES on the list that this workflow triggers off, so the workflow then restarts again and resends the approval.
 
This then triggers a fresh run of this workflow and the first steps at the start of the flow are to cancel the previous approval and flow run. 
 
 
 
So our run history will look something like below with a particular SharePoint list ID timing out every 3 days and restarting unless someone approves the request within that 3 days. 
My question is, is there a way to set the run status of the timed out flow to something other then FAILED E.g. Cancelled? This is so we can exclude these from our failed flow report as they do take up a large portion of our failed flows but actually aren't failing, it's the correct action of the flow to be cancelled and restart. 
 
I'm currently just using the 'Cancel Flow Run' action which doesn't give many options, I'm assuming I'm going to have to find the flow run in the Dataverse table and change it's Status if possible??
 
Categories:
  • Verified answer
    NQFlow Profile Picture
    NQFlow 20 on at
    How to cancel a flow but not have it listed as 'Failed'
    Put a Terminate and set it to cancel
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on at
    How to cancel a flow but not have it listed as 'Failed'
    Hi
     
    I swear I answered this same question the other day (well I did) just not sure it was you.
     
    You have a couple of options
     
    1. You first, can create a Branch (in Parallel) and set it to Timed Out, in there you can use Terminate true.
    2. You Catch the error, not simply have a terminate that catches Skipped/TimedOut/Error
     
    And so on.
     
    Do you want it to Succeed, but log something somewhere that it didn't actual do all of its work?
    Or do you want to terminate it where you can only use a few options but not do anything else
     
    I would suggest you do the Combination of Catching the Error, Logging something and then use Terminate, not just one or the other. Log something in a list or table or blob. You are going to want more than just looking at the List of flows and going oh it says cancelled.. Cancelled why? etc.
     
     
     
  • Suggested answer
    SM-24080244-0 Profile Picture
    SM-24080244-0 2 on at
    How to cancel a flow but not have it listed as 'Failed'
    @janeway5 You can you Terminate flow action

    It has status option "Cancelled"

     
     
     
    It will show canceled in the run history.


     

    If this answers your query, please mark it as answered. Thanks!

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard