Dealing With Failed Steps Gracefully

Power Automate is great for fast development of automation with Microsoft365 but how do you automatically handle it when it goes wrong or hits an issue?


Problem: When running Power Automate there are sometimes things outside your control that can trip up a Power Automate Flow; for example a user having a file open during a rename process

One Solution: I used the parallel steps to split the processing to handle errors of steps if not completed properly, and configure the following step to only execute if it’s a failure.


Here’s the Power Automate proof of concept.

In my case, I’m building a file rename flow, which is most likely to fail if the user has the document open.

So I’m going to add my Sharepoint rename step within a SCOPE step for ease of management.

Next, I’m adding the failure step - what happens if that doesn’t work and generates an error. (in this case, a second SCOPE step.

Then I’m going to open the context menu and select Configure Run After.

Screen_Shot_2020-11-30_at_9_17_29_PM.jpg
Screen Shot 2020-11-30 at 9.17.44 PM.png

Change the options so that this step will only fire after the previous step has failed.

Click Done.

All the steps you add here, will only be executed if the main operation step generates a failure.

Next add the success step; add a new step directly between the main operation step and the failure step you have created.

However when picking the type of action - select ‘Add a Parallel Branch’

Screen Shot 2020-12-01 at 7.52.27 AM.png
Screen Shot 2020-11-30 at 9.18.11 PM.png

This will default to an ‘on success’ action (you can check by using the context menu and selecting ‘Configure Run After’.)

All the steps in this branch will be completed if the main operation was a success.

Using this parallel branching on failure, we can now handle exceptions and errors.

Continuing and Rejoining Branches

If you’re doing this in the middle of your flow, you may want to add more steps or even re-join these branches.

To add more steps, simply click the ‘+’ icon under the last step as you would to insert a new step.

Screen_Shot_2020-12-01_at_8_03_01_AM.jpg
Screen_Shot_2020-12-01_at_8_03_39_AM.jpg

To rejoin the branches, simply click on the +Step button at the bottom.

(It wont work from the ‘+’ icon in the branches)

Then select the step you’d like to use to continue your flow.

Previous
Previous

Get count of CDS Records Returned from LIST RECORDS Step

Next
Next

Identifying Sharepoint File Locks With Power Automate