08-23-2022 02:23 AM - last edited 08-23-2022 02:31 AM
When creating workflows, we find it very helpful to use error logging to track Power Automate results so they can be supported by a broader audience.
By default, Power Automate will exit the flow at the point of failure. Periodic email notifications will be sent to the owner(s) of the Power Automate. Here you can see a 28-day run history and any run failures.
Note: if a Power Automate fails continuously for 14 days, it will automatically be turned off
So, from my point of view, it’s necessary to log somewhere the errors in order to:
There is better way for handle errors and log all Power Automate flow instances to a single place.
In my case, I’m storing the PA errors in a Dataverse Table, but it’s also possible to use for instance a SharePoint List.
Here the steps to be followed:
So, click on the “Scope-Catch” 3 dots and select “Configure run after”
Then, select the options “has failed” and “has timed out”, finally click on “Done”.
Within the “Scope-Catch” control, please add in sequence the following Actions:
workflow()
concat('https://emea.flow.microsoft.com/manage/environments/', outputs('Compose-WF_ID')['tags']['environmentName'], '/flows/', outputs('Compose-WF_ID')['name'], '/runs/', outputs('Compose-WF_ID')['run']['name'])
result('Scope-Try')
string(item()?['outputs']?['statusCode'])
does not start with string('20')
workflow()?['tags']?['flowDisplayName']
items('Apply_to_each-Add_PA_Error_Logging_row')['outputs']['body']['error']['message']
Here the entire “Scope-Catch” control:
Here the output:
Hope it helped!
Thanks for your feedback.
@DamoBird365 @Paulie78 what do you think about this topic?
My blog site about Power Automate: https://powerautomatejoy.com/
BR,
Marco
What are the intended use cases?
I’ve created a pretty simple template for immediately alerting flow owners of failures for less enterprise-level scenarios: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Flow-Failure-Notifications/td-p/1494079
So in a lot of cases I think it should be the flow owner’s responsibility to troubleshoot errors & ideally one creates their flows in a way where it won’t consistently error to the point where they need a long log of all the errors.
Is this more for monitoring teams of flow builders & keeping failure records for historical analysis, identifying training gaps, & common issues?
Or could it also be used for other things?
I wonder if Microsoft somehow tracks this kind of stuff across most users.
It would be interesting if we could see a consistent display of the most common errors across most users on the platform. Then people could better target their content & training aids.
Hello @takolota ,
many thanks for your feedback!!!
For sure, in regards of "critical" flows, we can manage the instant Teams/Email notifications, just to be sure that the user is notified and takes actions as soon as possible.
I'd prefer to store the flow failures somewhere (i.e. Dataverse or SharePoint), in order to:
I'd love if Microsoft in the next future will release something like a much more consistent report and not limiting, like today, the history to 28 days!
I may not have all the answers, but I'm curious and passionate enough to keep looking for answers and to keep sharing them.
My blog site about Power Automate: https://powerautomatejoy.com/
BR,
Marco