Building Error Notifications in Power Automate
When automation powers your workflows, efficiency soars—but even the best automations can encounter hiccups. That’s where Power Automate notifications on failed runs become your unsung hero. Without them, you might only discover a problem once it’s snowballed into a bigger issue, costing time, resources, or worse—customer trust. By enabling notifications for failures, you gain real-time or near-real-time awareness, allowing you to swiftly identify and address errors before they disrupt your operations. It’s not just about troubleshooting; it’s about staying proactive, minimizing downtime, and ensuring your automations work as hard as you do. Don’t let silent failures derail your productivity—let your automations speak up when they need your attention.
Creating error notifications in Power Automate can be achieved in several ways. One effective method is using the «Run After» settings and Scope actions. Here’s how you can set it up:
Add notifications to every power automate
Configure Run After Settings
For each action in your flow, use the «Configure run after» settings to specify what should happen if an action fails, times out, or is skipped. This allows you to create alternative paths for error handling.
Use Scopes for Error Handling
Group related actions into scopes and use scopes to handle errors collectively. Implement a try-catch pattern using scopes to manage errors effectively.
Send Email Notifications
Add an email action to send a notification if a specific action fails. You can use expressions to create dynamic links to the specific flow run in the email notification.
Terminate Action
Use the Terminate action to mark the flow as failed and avoid confusion. This ensures that the flow stops running after an error is encountered.
Error notifications typically gain importance after the system has been running for a while or when you take over the management from someone else.
New Preview Functionality from Microsoft
With the new preview functionality from Microsoft, error notifications can now be handled without editing all your previous flows.
To activate the preview feature needed for this notification:
- Go to admin.powerplatform.com.
- Select Environment from the left-hand menu.
- Choose the environment you want to enable it for.
- Click Settings and expand the Product menu.
- Go to Functions.
- Scroll down until you find the section Cloud flow run history in Dataverse.

This feature will start recording all flow runs in the table Flow Run (db name: flowrun
), including succeeded, failed, and cancelled runs. Since all runs are stored, it is beneficial to choose a saving time for the table based on your needs and the number of flows run every day. The settings can be set to disabled, 7 days, 14 days, or 28 days.
Example of Stored Runs
Below is an example of the runs stored:

Monitoring Business-Critical Flows
If there is a business-critical flow you want to monitor, you can create an instant trigger for the flow run. For this example, I will use a scheduled flow to provide a summary every morning of the flows that failed the previous day.
Overview of the Flow Creation
- Create a Scheduled Flow: Set it to run at your preferred time and give it a meaningful name.

- Initialize Variables: Initialize two variables, an array and a string variable.

- List Rows: Use the Dataverse connector to list all the failed rows for the last 24 hours. Select only the necessary columns, I have used the following:
status
,_workflow_value
,workflowid
,createdon
,_ownerid_value
.

Filter Rows: Filter the rows for the last 24 hours and failed status. Note that the status here is a text field and not your regular choices: createdon ge @{addHours(utcNow(),-24)} and status eq 'Failed'
Sort descending based on createdon
: createdon desc
- Check Returned Results: Use a length formula to check if the list row returns one or more results. If not, there are no errors, and we terminate the flow as succeeded:
length(outputs('List_failed_flows_yesterday')?['body/value'])
This returns the number of rows from the list, and if this is 0, there are no errors.

Handling Errors
If the condition is true, proceed to the «if yes» branch:

- Loop Failed Runs: Loop through all the failed runs.
- Get User Information: Retrieve the user information from the owner to print the owners full name in the email.
- Get Workflow Name: Use a Get row on the processes table to print the name of the failed flow.
- Set Environment URL Variable: This is used to print the environment URL in the email:
uriHost(body('Get_user')?['@odata.id'])
- Save Information in Array: Save the full name and workflow name in the
flowNames
array with the following JSON:{
"Workflow": "@{outputs('Get_workflow')?['body/name']}",
"Owner": "@{outputs('Get_user')?['body/fullname']}"
}
- Create Unique Array: Use a compose action to union the array with itself to ensure each flow is listed only once:
union(variables('flowNames'),variables('flowNames'))
- Create HTML Table: Use the Create HTML table action to create a quick and clear overview of the errors to include in the email.
- Create Email: Include the output of the Create HTML table action, the environment variable, and the length of the list action to get the total number of errors visible in the email. The formula for the length for your convenience is: length(variables(‘flowNames’))

Overview of the flow
This is a overview of the full flow to make it easier for you to follow these guides:

The resulting email
Every morning the flow will run and if errors are found in the flow run table it will create an email on the following format:
