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 / PAD flow failing but n...
Power Automate
Unanswered

PAD flow failing but not throwing error -- job completes successfully when it shouldn't

(0) ShareShare
ReportReport
Posted on by 103

I have a weird problem happening with a PAD flow that is in production currently.

 

The flow uses UI automation to enter data into our ERP software. I have error handlers setup to handle different issues.

 

The flow starts with the UI automation and has an "On block error" wrapped around the subflow to handle any errors.

 

rmortier_0-1660914102579.png

 

In the following screenshot, you'll see I have it set to continue the flow. This is because I want to catch the output variable "ContainerTicketError" in the cloud and take further actions but only if the error was handled successfully and the PAD flow didn't fail unexpectedly which is where the "UnknownError" happens further below.

 

rmortier_1-1660914148797.png

 

The following screenshot is the error handler flow for the above error that as you can see is wrapped in another "On block error". This error handler is simply emailing a screenshot to specific users so they can see what happened without me going into the error context in the PA console to get it for them.

 

rmortier_2-1660914264976.png

 

This second "On block error" is in case the "ContainerTicketErrorHandler" fails and is then set to throw an error.

 

rmortier_3-1660914328917.png

 

The "UnknownErrorHandler" subflow is simply to logoff the user which is effectively resetting the environment for the next queued job because I'm using the "reuse sessions" option on the machine.

 

rmortier_4-1660914368083.png

The problem I'm running into is that the PAD flow is not throwing an error even if the UnknownError block is hit.

 

rmortier_5-1660914476878.png

 

What is happening here?

 

Thanks.

 

 

edit:

 

Here is a flow that I was testing the exact same setup with where I intentionally error it out in both the main flow and the error handler subflow with a division by zero error and as you can see it works as intended.

 

rmortier_0-1660915156900.png

 

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Use 'Stop Flow' with Error Message inside your OnErrorBlock. 

    MichaelAnnis_0-1660922150373.png


    If an OnErrorBlock flows successfully, then the flow is still seen as being successful, but you can force it to throw an error in your logoff block.

    Best of luck!

      

  • rmortier Profile Picture
    103 on at

    Interesting. I had tested using that at one time and the cloud side still saw the flow complete successfully. I will test again and update.

  • rmortier Profile Picture
    103 on at

    edit: my bad, still testing

  • rmortier Profile Picture
    103 on at

    Ah ha! I figured out the problem. The "Log off user" action is effectively terminating the flow as successful. It doesn't proceed further. I tried adding a "Stop flow" action after it, but it doesn't get hit and therefore doesn't error out.

     

    Workstation - Power Automate | Microsoft Docs

    "In all cases, the action will terminate the flow."

     

    Anyone know a way around this other than not using the "Log off user" action? I simply just want to log off the user AND throw an error.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Check this out:

    https://superuser.com/questions/631239/windows-7-command-line-timed-log-off

     

    Instead of using Logoff User, use a command line with a delay, such as +1 minute.  Then throw the error, so the flow successfully finishes and reports back to MS Power Automate, then the user will get logged off a minute later.

     

    Best of luck!

  • rmortier Profile Picture
    103 on at

    Thanks, I'll check these 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard