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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Is there a way to remo...
Power Automate
Suggested Answer

Is there a way to remove / delete approval tasks if a flow is canceled or terminated?

(2) ShareShare
ReportReport
Posted on by 8

I have a Flow which has multiple approvals (some which run in parallel) and I am wondering if there is a way to remove / delete approval requests if the flow is canceled or terminated? Currently, if a flow is terminated or canceled it leaves the orphaned tasks in the user's approval queue.

For instance if I have 3 parallel approval activities:

Approval1, Approval2, Approval 3

If Approval 1 is Rejected, I would like to essentially cancel the flow / terminate and delete the Approval requets sitting in the user's Approvals queue which were assigned in Approval 2 and Approval 3 since they don't need to be answered anymore since Approval1 was rejected.

Is this possible? 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @dadams :

     

    Can you use a single approval set to "Everyone must approve" and list all 3 approvers in that single action?

     

    The only way I know of to cancel an in-process approval is to use a time out and I suspect that using a time out will not meet your requirements.

     

    Scott

  • dadams Profile Picture
    8 on at

    Hi @ScottShearer ,

    Unfortunetly I can't do a single approval step since it is three different groups of users and 3 different approvals.  Essentially for that step in the process I have  Facilities Group A, Facilities Group B, and Facilities Group C that all need to approve or reject this for their specific facility.  If one of the facilities rejects the other facilities don't need to respond anymore since all 3 need to approve to proceed in the process.  Each Facility has to approve for their group and we can't move onto the next stage in the process until all of the Facility owners have approved.

    The issue I am having is that if one of the groups rejects, it leaves orphaned tasks that look like they should be acted upon for the other two groups of users.  It would be great if there was an action that would cancel / delete Flow Tasks associated with a flow instance on cancelation or termination.  Thank you for the response though!

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

    @dadams :

     

    If I understand your issue, you have 3 approvers.  All 3 must approve - if any of the 3 reject then you want the other approvals cancelled as the process cannot proceed.

     

    If my description is accurate, then this is exactly the scenario that an approval with the "Everyone must approve" option selected was designed to address.  If anyone does not approve, then the approval process stops and the request is rejected.  This single approval is assigned to all 3 approvers.

     

    AllApprove.jpg

     

    Additional documentation can be found here

     

    If this addresses your issue, please mark your post as Solved.

     

    Scott

  • dadams Profile Picture
    8 on at

     

    @ScottShearer 

    Sorry for the late replay I was out on PTO part of this week.  I have inclued a screenshot to better illustrate what I am trying to convery.  I have 3 seperate approvals (approving different aspects) and  3 seperate groups that receive the cooresponding the request.
    approval.PNG

     

     

     

     

    I can't do the approvals sequentially such as IT approves, then facilities, and then supply chain due to buisness reasons.  These three groups should each receive an approval request at the exact same time, so I have them doing that via parallell branches in the flow.  What I was hoping to do is that if lets say IT rejects the approval request, that I could then remove the tasks which were assigned by the facilities and supply chain which were assigned.  Currently I have the workflow terminating if one of these approvals is rejected, but once it is terminated it is leaving the orphan tasks in the user's queue from the other approvals which are no longer needed since the flow has terminated.  If all of these steps are approved the workflow continues through the rest of the steps.

    Thanks Again,

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

    @dadams :

    Please test the "Everyone must Approve" approval as I have suggetsed above.  Assign the approval to all of your approvers - the same approvers you used in your parallel steps. Explain in the approval request details that each approver is approving for their particular area of responsibility only.

     

    There is currently no method to cancel an approval other than using a time out.

     

    I believe this will meet your requirement.

     

    Scott

  • Community Power Platform Member Profile Picture
    on at

    even if it times out the approval remains on the users list - i hope microsoft will add remove approval as an action in power automate at somepoint ...

  • HotTubLukso Profile Picture
    34 on at
    Both timeouts (30 day) and cancelled items from the flow, still show as active in the users approvals framework. It is a big flaw in the structure of microsoft approvals. If you ever found a workaround or anything in regards to this, please post or send me a DM.
     
    Thanks!
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    I am not sure if this has been answered, but this is how I handle the situation you describe.
     
    In the above, the right side of the parallel branch handles when the flow times out. I set a variable for the task outcome, but you can just delete the task from Dataverse if preferred. Just be sure the first action on the right side only triggers if the approval times out.
     
    Configure the Delete a row from Dataverse action as follows:
    Note: if you use the separate Create an approval and Wait for an approval action like I do, be sure that the Approval ID is coming from the Create an approval action.
     
    To handle a cancellation, I use the default case in the switch to check for this. 
    For the Get a row by ID, point it to the Approvals table and for the Row ID, choose Approval ID from the dynamic content, again ensuring it is the one from the Create an approval action:
    In the condition, check of the Status Response Code from the Get a row action is equal to 1923500006, which indicates the task was cancelled:
     
     
    Then do what you want for the cancellation. In my experience, if someone cancels an approval task, the assignee is notified that it has been cancelled. If that is not happening, I suppose you could delete it like when the approval times out.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard