Use the Try Catch component

  • Release version: Australia
  • Updated March 12, 2026
  • 2 minutes to read
  • Catch an error or exception that occurs in a component in an automation and transfer control to the other components within the automation.

    Before you begin

    Role required: none

    About this task

    To configure the properties for the Try Catch component, see Properties of the Try Catch component.

    For details on the issues related to the Try Catch component, see KB article KB1123551, KB article KB1123552, and KB article KB1123556.

    The Try Catch component enables you to define which components run within the exception-handling scope and which run outside it. When an error occurs in a component within the Try scope, the component captures the exception and stops execution of the remaining components in that path. You can connect an alternative flow to the On Error port to handle the exception. Components that must run outside the exception-handling scope can be connected to the Finally port.

    You can use multiple instances of the Try Catch component in an automation to handle errors from other components along the same execution path. If an activity that contains a Try Catch component calls another activity that doesn’t include the Try Catch component, the Try Catch component in the calling activity can still catch errors from the called activity.

    Procedure

    1. In the Toolbox pane, navigate to General > Try Catch.
    2. Drag the Try Catch component to the Design surface.
    3. Connect the ports of the Try Catch component to the corresponding ports of the other components or activities as described in the following table.
      Table 1. Try Catch component port parameters
      Port type Port name Data type Purpose of connection Default value Mandatory?
      Control Out Control-Out Not applicable When there is no error, passes the control to another component or an activity. Not applicable Yes
      Control Out On Error Not applicable Passes the control to another component or activity after the Try Catch component catches an error.

      Use this port after the Try Catch component catches an error or exception and you want to execute another component in the current or another activity.

      Not applicable No. Connecting the port is optional.
      Data Out Error Message String Returns the error message. Not applicable No. Connecting the port is optional.
      Data Out Finally Not applicable Enables you to execute component or activity after Try and Catch, regardless of whether an exception occurs or not. Not applicable No. Connecting the port is optional.
    4. Optional: To test the component, right-click the component bar and then select Run From Here.
      Note:
      The Try Catch component may not work as expected with the Parallel component.

    Handling errors while processing an Excel file

    An automation uses a Try Catch component when reading data from Excel. If the ReadFromExcel component fails because the file path is empty, the Try Catch component captures the error and displays the error message using a MessageBox. The Finally path then runs and displays the current date and time before the automation ends.

    Example of exception handling in the Try Catch block.