Restart from activity X on error

I am automating a website that sometimes throws an error in the middle of the process. The easiest way to bypass the error is just to go back to the home page, log in again and do the process again.

the tricky part is the error can show up at any step of the process, and the solution is always the same, go back to the start of the process (this is not the start of the ENTIRE UiPath process, rather the start of the use browser activity)

What is the best way to add something that will go back to a previous activity on error?

Hi @benben

One approach to handle errors and go back to a previous activity is to use Try Catch activities.

→ Add a Try Catch activity.
→ Inside the Try block, place all the activities that are prone to throwing errors.
→ In the Catch block, add a Navigate To activity to go back to the home page of your website.
→ After the Navigate To activity, add a Log Message activity to indicate that the error occurred and the bot is going back to the start of the process.
→ Finally, add an Invoke Workflow File activity to call the workflow containing the entire UiPath process from the beginning.

Hope this helps,
Best Regards.

Thanks for your reply!

For the last step, the workflow I want to restart Is in the same file, just a few steps above it. how do specify for it to restart from that specific step?

if you are using REFramework i suggest you add these columns to your input excel (1 column per step)
when a step is completed, mark that step as “Done”,
In Process.xaml, add logic for the robot to find out which step is not “Done” for that particular transaction row and start from that step

By doing this, whenever theres an exception and you are restarting the transaction row, it will start at the CURRENT step and not the very first step

Thanks for your reply. I am not using REFramework or excel, just created the steps in studio. is there a way to create this process you described in studio?