Skip to main content

Notifications

Community site session details

Community site session details

Session Id : caT6q9oOQfXJo4hxERP3Pf
Power Automate - Building Flows
Answered

Error Handling and logging advice/patterns in Power Automate

Like (0) ShareShare
ReportReport
Posted on 11 Feb 2025 12:08:22 by 39
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.
  • Verified answer
    satya_vijay_2025 Profile Picture
    76 on 11 Feb 2025 at 12:58:46
    Error Handling and logging advice/patterns in Power Automate
    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started
Loading complete