Best practice : Try and Catch on the entire workflow?

Hey everyone

Can someone guide me what is the best way of doing a Try and Catch on the entire workflow?

The idea is this:

  1. If any Exception is raised whilst the robot is running to stop the process, close the window in the Java app and the Robot to reopen the window.
  2. Mark the transaction as Failed in Orchestrator.
  3. Send an API call back to an endpoint that there was an issue
  4. Move to the next Queue Item

My ideas:

  1. Try Catch Finally on the entire Worfklow?
  2. In Exception to use Set Transaction Status activity to Failed and do the HTTP Request?
  3. In Finally to close the window that the robot is currently in and reopen it?

Or you would suggest a different approach?

Bonus would be, if it fails again, to stop the entire process. If this is too complicated and have to use counters and such then as soon as it fails to raise the alarm and kill the process and not to move to the next Item (that Item to remain as New).


You can use the REFramework (combined with your ideas) for this,

  1. Get transaction data - get current queue item
  2. Process transaction - There is already a try-catch here,
    image
    • Try -> you can insert your main workflow (that handles one queue item) so basically your main workflow will be surrounded by a try catch
    • Catch - close the window in the Java app and the Robot to reopen, and send API call to endpoint that theres an issue (You can delete the BusinessRuleException part if you dont care what exception is thrown and just want the robot to process the next queue in the event of any exception)
    • Finally - robot will call “SetTransactionStatus” workflow here, by default this sequence will increment the counter depending on whether or not you set a max retry count and whether the excpetion is a system/business exception,
      • here you can close the window that the robot is currently in and reopen it
  • after this it will go back to get the next queue item / retry current queue item based on the counter
1 Like

Thanks Jack

I will give it a try.