Configure run after option
The Configure run after option and email notification is beneficial in helping you swiftly resolve issues with your workflow run.
Use the Configure run after option to handle errors
With the Configure run after option, you can identify which step failed and, if it did, bring that to your attention. The setting is successful, in the notification is the default; however, you would use the has failed setting to handle errors.
Consider a scenario where, after you upload an image to a SharePoint library, you decide to send it to Microsoft Azure Cognitive Services, an AI and machine learning service, to analyze the image. After the image is analyzed, you can save all tags that Cognitive Services created in SharePoint if you set up a workflow.
The first step is to send the image, or the file content, to the Analyze Image action in the flow.
Because multiple tags are received, they're first added to an array variable, and the variable is saved in a property column in the SharePoint library.
Add a parallel branch for immediate notification
Adding a parallel branch allows you to add a mobile or email notification step to inform the maker of the flow in which an issue occurs.
The following image shows that, after the Analyze Image action, a parallel branch is added.
A Send me an email notification parallel step is selected.
In the Configure run after action for the email notification step, the has failed, is skipped, and has timed out settings are selected.
Note
This action is directly tied to the success of the previous step, which in this case is Analyze Image, as shown by the following screenshot.
Now, you successfully added a step to handle errors that the Analyze Image action might encounter. You can repeat this error handling step for other important actions.
Use Parse JSON to get the current flow run information
If you call workflow() in Power Automate, you get a JSON object that contains information about the Flow and the instance, including the current environment guid, Flow name, Flow guid and run ID.
You can then parse that information and build a URL out of it. So if an action fails, you can configure run after an email action (explained above), and have a link directly to that flow action.
Important
When you Parse the JSON from workflow(), two name properties are outputted. Make sure you select the run name
For more information about the workflow() function, see Power Automate Workflow function.