Try, Catch, and Finally In Microsoft Power Automate/Microsoft Flow | Error Handling Using Scope

Error handling and TRY, CATCH, AND FINALLY are very important tasks in Programing as well in any kind of development & Microsoft Power Automate or Microsoft Flow is no different.

Error handling and TRY, CATCH, AND FINALLY can be easily implemented in MICROSOFT POWER AUTOMATE/MICROSOFT FLOW for handling different different business scenarios.

You can place your main actions inside TRY BLOCK . Due to any exceptions or errors, if TRY BLOCK will get fail then CATCH BLOCK will execute. FINALLY BLOCK will run everytime.

There is Try, Catch, and Finally Template provided by Microsoft Flow Community –

Lets understand this with an example.

  • Create a flow with Manual Trigger. This is an example trigger. It can be replaced if required.

  • Then add an action SCOPE. Scope Action in Microsoft power automate or Encapsulate a block of actions and inherit the last terminal status (Succeeded, Failed, Cancelled) of actions inside.

Name the scope as TRY. In Try Scope you can define main steps or actions.

  • After Try Scope, add another SCOPE “Catch”. Catch Scope will execute in case of a error or exception in Try Scope. You can place your error handling logic in Catch Scope.
  • Configure Run After of Catch Scope & select the option “Has Failed” = Yes
  • After Catch Scope, add another SCOPE “Finally”. Finally Scope will execute always i.e. in both for failed and successful runs
  • Configure Run After of Finally Scope & select the option “Has Failed” = Yes, “is Successful” = YES, “is skipped” = YES & “has timed out” = Yes
  • Your final flow should look this

2 thoughts on “Try, Catch, and Finally In Microsoft Power Automate/Microsoft Flow | Error Handling Using Scope”

  1. How to manual cancel flow when running? I am injecting code which cancel all flows as follows:
    Cancelling all running flows in Power Automate – 365 HQ
    Thank you to the ever brilliant users in the “Microsoft Power Automate Community” for delivering this solution. This is just brilliant.
    1. Navigate to the flow in question
    2. Click on “All runs”
    3. Filter the view to only show the running flows
    4. Open the console in the browser (hit F12 and the select console)
    5. Paste in the code below. For some reason I need to paste the jquery part twice before the actual action code, but it works like a charm. Depending on the number of flows you have running, this can take quite a while.

    //Include jquery (you may need to paste this following twice)
    var jq = document.createElement(‘script’);
    // Cancel all running flows ( This part you only paste once)
    confirm = function () {return true;};
    setInterval(function () {


Leave a Reply