How to send email and goes back to certain activity when there's an error anywhere in the project

I have different activities such as type into, access browser, if else etc. in a sequence.

The process is to access each PDF in the folder, extract all necessary values from it, access the system, and create order using those values. The process is running okay already.

But if there’s an error anywhere in any activities, I would like to get an email with customized information for eg: “The order 01 is not able to be created. Please check.” and the process goes back to the activity that access PDF. It needs to go to another PDF and continue the process as usual. And same thing, if any error occurs again, I get an email and the process goes back to the activity that access PDF and access another pdf.

I’m still a beginner so could you help to guide me and give suggestions on this?

Hi @Sein_Lai_Hnin,

If you use REframework, you could handle this scenario. Try to implement it if possible.

1 Like

I tried using global exception handler and it’s working now. But I’ll take a look at how REframework works as well. Thank you for your reply. Appreciate it!

Hi @Sein_Lai_Hnin ,

That’s great.

@Sein_Lai_Hnin ,
I guess you are using a single sequence for the flow?
You are looping each files in the folder right? So u can give a try catch inside the for loop and give the body contents inside the try block , so you can just give your send mail activity in the exception block , if any error occurs it will send a mail and then it will go for the next file

1 Like

Hi @Sein_Lai_Hnin

You Can Follow @muhamed_fasil Solution Since you are using a Sequence not Re-Framework

1 Like

@Sein_Lai_Hnin ,
eg of the structure

1 Like

oh ok.
Currently I implemented like this.



So the project runs and when there’s an error, it goes to the global exception and emails me the error log. And then ignore that activity and goes to the next activity.
But I will give it a try with try catch as well to see if it’s simpler or not.
Thank you.

@Sein_Lai_Hnin ,

here there is another issue, while you give it to global exception , even your assign activity gets an error , the mail will be triggered

yes correct! I would need the error msg for assign activity also. I would need the assigned value to fill in a form and if the assign value got error, then i get email so I would know the form got error value and the order is not created.

@Sein_Lai_Hnin ,
then you can use the same , good work :+1: