web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error Handling and log...
Power Automate
Answered

Error Handling and logging advice/patterns in Power Automate

(0) ShareShare
ReportReport
Posted on by 44
Hi,
 
Just a general question to the community about error handling and logging in Power Automate. I have constructed various flows, but I'm not certain about best practices when it comes to handling errors, exceptions and logging.
 
1. I would prefer to log to an Application Insights resource on Azure, but is this recommended? 
2. How can I manage the alerts that are fired based on the flow performance? For example, when a flow has failed several times.
3. When should the terminate action be used? For example, if I have a parallel branch that runs on failure of the previous action, do I need a terminate action, or should I let the flow end normally?
 
Any advice on error handling patterns or logging would be much appreciated.
 
Thanks everyone.
Categories:
I have the same question (0)
  • Verified answer
    satya_vijay_2025 Profile Picture
    76 on at
    1)I would prefer to log to an Application Insights resource on Azure, but is this recommended?
    Ans : You can definitely log to Application Insights. However, if you prefer not to use Azure resources, you can also log the data to a table in Dataverse. You could set up custom usage tables in Dataverse for this purpose.
     
    The Dataverse Table is only recommended when the log volumes are very less - the volume is going to be high it is better/recommended to use App insights. However, Dataverse is cost efficient - because you are not using additional azure resource.
     
    2) How can I manage the alerts that are fired based on the flow performance? For example, when a flow has failed several times.
    Ans: Are you referring to Azure Application Insights or something more general?
    If you're using Application Insights, you can set up an alert to check the flow failure count within the last hour. For example, if there are more than 15 failures (assuming that’s your threshold), you can trigger an alert.
     
    Write a query some thing like below 

    PowerAutomateFlowEvents
    | where Eventname == "FlowFailure" 
    | where timestamp > ago(1h)   
    | summarize failureCount = count() by bin(timestamp, 1h)
    | where failureCount >= 15
     
    If you're logging data in Dataverse, you can create a monitoring flow that checks the log table every hour, counts the number of failed rows, and sends an email alert if the failure count exceeds your threshold (like 15).
     
     

    3) When should the terminate action be used? For example, if I have a parallel branch that runs when the previous action fails, do I need a terminate action, or should I let the flow end normally?
    Ans : You can let the flow end normally in most cases. I typically use the "Terminate" action to stop the flow early without running any further steps. If one action fails, and you still want to continue with other actions because they’re not dependent on the failed one, you don’t need the "Terminate" action. The "Terminate" action should be used if you want to prevent unnecessary actions from running after a failure or produce incorrect outcomes after a failure


    - Sathya Vijay

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard