Exception Handling in Power Automate Desktop using On Error Block action
    • Dark
      Light
    • PDF

    Exception Handling in Power Automate Desktop using On Error Block action

    • Dark
      Light
    • PDF

    Article summary

    Recent changes to Power Automate Desktop now allow us to manage exceptions in Power Automate Desktop more holistically. This new capability is found in the On block error action. This action works similar to a ‘Try-Catch’ block that we find in other programming paradigms or like scopes inside of Power Automate API flows.

    Initially, we had to manage exception handling on a per-action basis with Power Automate Desktop. Now, we can add an exception handler around a group of actions. Should any action fail within that group, our On block error exception handler will be invoked.
    1-OnBlockError

    As part of our On block error action we can indicate what actions we would like to take when an error does occur. One option we can leverage is to call a subflow. We can design our subflow to be reusable so that any On block error action can use it. Inside this subflow, we can include the ability to write to a log file, a database, API or other source. To use this feature we must first create a subflow and then we can reference it by selecting it in the Run subflow dropdown.
    2-runSubflow

    Conclusion

    Exception handling is very important in Robotic Process Automation (RPA) architectures due to the importance of the transactions that are being processed. By using the On block error capability, we can build robust automation processes that include a consistent way of dealing with errors.


    Was this article helpful?

    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence