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 / Failed action has 'run...
Power Automate
Suggested Answer

Failed action has 'run after failure' but flow still fails and gets turned off

(1) ShareShare
ReportReport
Posted on by 2
Hi,

I have a flow that checks if a future, current or passed employee has an O365 account. Normally accounts are blocked when an employee leaves the company and deleted after 90 days. We want a sharepoint list that doublechecks.
  1. Once a day the flow is triggered
  2. We 'get items' from a sharepoint list of all employees
  3. We use ‘get user profile (v2)’  in a loop to get every employees O365 profile
  4. If they have a profile -> the user has an account, we check if it’s enabled or disabled and write this to our sharepoint list
    If they don’t have a profile -> ‘get user profile (V2) fails. We’ve set a ‘run after fail’ and write ‘no account’ to our sharepoint list.
No issues there. It works perfectly.

Except, when ‘get user profile(V2)’ fails power automate considers the entire flow a failure, even though a run after fail is set. After a while it turns the flow off automatically because it keeps failing.

I can’t use a terminate action, because my loop still needs to cycle through all the other employees.
 
Any ideas?
 
Thanks
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,417 Most Valuable Professional on at
    It sounds like you are using the Run After inside the loop.  That will work, but it doesn't prevent the error from rolling up to the containing loop.  So make sure you have at least one action after the loop finishes set to run when the loop succeeds or fails.  Here's a screenshot of an example.  You can see that the Get user profile failed and the run after action runs. But the flow itself failed until I added the final Compose set to run if the loop succeeded or failed.
  • abc 123 Profile Picture
    789 Moderator on at
    Due to the fact that Microsoft takes it upon themselves to turn off a Flow that "Fails", I now try to terminate with a "Cancel", instead of "Fail", whenever possible. For example, logical errors get a Cancel, but calls to a Child Flow that choke still get a Fail. 
     
    To do this, initialize a variable, called strFlowStatus, to "Success".
    Whenever a trapped error happens, set the variable to "Cancel" when in that branch.
    If the Flow truly fails, meaning a non-bizlogic fail, then set the variable to "Fail".
     
    At the end of the Flow, add a Switch Action, and Handle each status, "Success", "Cancel", and "Fail", separately.
     
    For extra credit, when there is a true Fail, I send an email to myself.  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 862

#2
Valantis Profile Picture

Valantis 738

#3
Haque Profile Picture

Haque 553

Last 30 days Overall leaderboard