Hi,
Why on earth doesn't output variables work when desktop flow errors?
I have an error block set for a "MainErrorTask", and in the block I am, closing open windows and files, setting output variables with i.e. loop no, row no. etc.
In my Power Automate flow, where the desktop flow was triggered, I then have a "if action failed" run desktop flow again, and I have input variables with the values from the output variables, this way my desktop flow can start again, and automatically navigate to the correct loop, row etc. - I am doing this, since sometimes all that went wrong was a webpage that did't load properly or something like that, and running the desktop flow again will not result in an error. I of course have a maximum of re-runs set in my flow, and emails notifying me etc, but as the output variables doesn't populate in cases of errors, then this won't work!
As a workaround I choose "Continue flow run" instead of "Throw error", and then in my subflow MainErrorTask I am ending it with a "Stop flow" action, but this is really not neat, as it will show my flow history as all went fine with the flow, which it didn't!
This is definitely a feature request!
Thanks
Ghita
Not unless you implement proper error handling. You would need to use On block error to catch the error and then call a sub-flow that runs Get last error. The output of Get last error includes the name of the sub-flow where the error occurred, the name and index of the action, and the error message. So, basically, what you need. If you store that to an output variable, you'll get it after the flow fails.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
Ok, that's helpful. If I wanted to capture a failed action index, name, and error message it wouldn't be possible using output variables?
You still get output variables if it fails, but only if those variables were initialized in the flow before the failure. If no value is set to them before the flow fails, there's nothing to return.
Sorry to resurrect an old post, but how do I get the output variables if the flow fails?
My issue got solved with one of the latest updates to PAD. Using the “Get last error” and stopping the flow with a message. I am a happy camper now.
thanks for trying to help out though.
Hello @Anonymous ,
Thanks for the details.
If I am right, Data to the Output variable is written only after successful completion of the action.
When an action fails, immediately an error is Thrown, even before the Output variable can be updated, hence leaving the Output variable empty or Null value.
If you try to skip the action, using Error Handling, then the Action as well as the Output variable pertaining to that Action is jumped without any value to the Output Variable.
Either way, it is mandatory for the Action to be completed in order to Populate a value to the output variable.
Else the Output variable will not be able to Output values.
My whole issue is, that I want the PAD flow to Throw and error! Even though it is throwing the error, I still want my output variables to output values! This is the issue. If I set the Error block to:
1. Set variable (my output variable)
2. Throw Error
The output variable is EMPTY.
If I set my Error Block to:
1. Set variable (my output variable)
2. Continue Flow Run - Run subflow
3. In the Subflow I will end flow
The output variable is set correctly, but my Flow will think (correctly), that the PAD flow ended successully!
I want:
1. PAD flow to end with throwing and error
2. Get the value of the output variable
I hope I have made myself more clear now. :0)
Hello @Anonymous ,
Based on your Description, if my understanding is correct, you are trying to use Error Handling in case the Flow fails in PAD.
You can use "Continue Flow Run" and On Error "Go to Label" where you can set the Label, pointing to an action where you want the Flow to start from again
Else as an alternative, you can also use the repeat action, in which case, the action repeats itself until the Application or Browser loads with correct data.
For the Query related to variables, you may find helpful content in the below Docs:
https://docs.microsoft.com/en-us/power-automate/desktop-flows/manage-variables
https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-manipulation
@Anonymous It's hard to figure out from your description. Please clarify what input and output variables you mean in the sentence "input variables with the values from the output variables"
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2