How to use TRY CATCH activity

Hi I’m a begginer.

I would like to use try catch activity so that if I get any ANY error during my automation process I want it to restart the whole thing. (to start automation from start to finish again if the error is encountered)

How do I use it?

What do I put in the “TRY” window? should I put all of my workflow there?

Then in CATCH should I choose every type of errors?

and then what should be put in “Finally” Window?

@chowus Hi
As a beginner, using the Try Catch activity in UiPath is a good practice to handle errors and control the flow of your automation. Here’s how you can use it:

  1. Drag and drop the Try Catch activity into your workflow.
  2. Inside the Try block, you should place the activities that you want to execute without any expected errors. This can be your entire workflow or specific activities that you anticipate might throw an error.
  3. In the Catch block, you can specify the type of exception you want to catch. To catch all types of exceptions, you can use the “System.Exception” type. You can also choose specific types of exceptions based on your requirements.
  4. Inside the Catch block, you can include activities to handle the error, log the error message, or take any necessary actions. For example, you can use the Log Message activity to write the exception message to the output panel or send an email notification.
  5. If you want to restart the whole automation process when an error occurs, you can place the entire automation workflow or the starting point of your automation process in the Re Try block activity.
  6. In the Finally block, you can add activities that you want to execute regardless of whether an error occurred or not. This can include cleanup activities or final steps to be performed.


Here you go:

How to Use the Try-Catch Activity in UiPath Studio

Let me know if you need any assistance in understanding.

A Try Catch isn’t the way to do this. You should have your process built as a Flowchart and then you can loop back to the beginning if there is an error.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.