How i can make alert with email?

If my bot face some exception error then it will send the email else it will run
How I can make this process?


Use Try Catch Activity. Within The catch use mail activity to send the mail with exception information.

1 Like

Just use a Try-Catch to surround your process and send the email when exception is caught

1 Like

Hi @Deepak_Gautam ,

If you are working with REFramework better to put in catch of parent workflow that is process.
You can also capture the exception Details their and send the exception mail.

Hi @Deepak_Gautam,

One way to avoid spamming with emails is to check if the bot has carried out all the retries for a given queue item.

If you are using the REFramework, like @ermanoj3101 said you can catch the exception in the Process Transaction, but avoid sending emails at every single application exception. If you do have to send emails, a better way to send emails is to either

  1. Use If–>TransactionItem.RetryNo > 2 (or the max retry number in your queue setting or config file) Only then send an email. This means that the bot has tried the queue item max number of times and now there is no other alternative than sending an email to a case handler.
  2. Use the Global Handler either in your REFramework process or any custom process and let the Global handler handle the failure by sending a email to the case handler.

In both cases, I hope you have a flexible email template which informs the receiver why he/she received the email. You can ensure this by having a good template email which takes in parameters. For example, the reason for the failure, how many times the robot tried the item? what the case handler can do to fix? Upto which stage did the robot carry out the process? (so that the case handler can continue from that step) and any other information you see fit.

Whatever process you choose, only use emails to alert case handler when you / robot are sure that there is no fall back (as the last resort).

Another thing to remember is that the email activity in itself may fail so what do you do then?
In my experience, emails should be sent after the process has finished all transactions. While the robot is running the process, it ensures that all failures are captured along with the item information and saved in temporary folder/file. Once the process is completed, it can trigger another process which only sends email. This way you decrease the chances of introducing failures into your main process.

Good luck!

1 Like

Thank you @ermanoj3101 ,

can it be possible see above image.

Put this workflow in try catch and if this is your parent workflow send mail in catch block.