How to retry email for 10 mins?

Hi,

I have a use case where , robot need to download the attachment from email at 4pm sharp.

Sender , subject is fixed .
I have already set up o365 email to get email and download attachment .
Now business team wants bot should wait till 4.10pm … if no email then send business exception to them.

If email exist then check attachment ,if no attachment send business exception.mail.

If attachment exist then … do further manipulation …

My ques ~
Can I use file path as transaction ?
I mean I know the name of the attachment . Which will be fixed.
So I will add in queue that path of local folder file…

For that 1 path…In process part I wil read email … and future things.

Now que is…

How to retry email for 10mins.??

Hi @Shruthika_r You can use the trigger mail which will trigger whenever new email arrived

please find below screenshot
The image shows the settings for an "Email Received" trigger for Microsoft Outlook 365, configured to monitor the "Inbox/Testing" folder with an option to add additional filters and an off toggle for using a shared mailbox. (Captioned by AI)

1 Like

@Shruthika_r,

Use Retry Scope and put your Get Mail activity inside it. Configure the Retry Scope Number of retries property to 10 and Retry Interval to 00:01:00.

This will keep checking for 10 minutes and if still not found the email it will throw system exception. Surround this retry scope with Try Catch and in Catch catch section catch this exception and throw it as Business rule exception.

1 Like

@Shruthika_r

Why not check after 10 mins only and process or send email onstead of doubg twice

Also you can use anything as transaction…but as you process is linear you dint need a transaction as well

Cheers

Hi @Anil_G
Thanks for reply !

As per business team , mail wil definitely will come at 4am . But if not bot should check 10more min.
Sooner is better as they have sla for that process if bot didn’t run they will manually do so they want notification …

Yes linear but then when they pull report of queue for some dashboard , that’s why without q process again will not come in reort n it has to always treated separate so…Adding 1 transaction…Also I will make use of default retry mechanism also if in middle it fails with SE.

I m more comfortable with q process.

Easy to send BE mails too …

So, please once again guide me . Is it fine to add transaction or still u suggest linear.

I m new learning developer since 2 years .

TIA!

Hi @Shruthika_r

You can add one more state in process
Name it as wait or delay state
Now if your get transition data reciived nothing got to this state and here add condition to check the time
If it is 4.10 and the is email retry is false go to load queue again or connect to steps where u will check email and set the flag value to true
If not 4.10 wait for give delay if 10 min again check time and if 4.10 and flag is false
Connect to check email and set the flag value to true

Now have one flag in process as is email retry
Now this flag will be false by default and now when u will wait for 10 min
Now the transition which is going back to load e-mail there check this flag if it’s true in transition condition

Now if again data is not there it will go this delay state where this flag is true so it won’t go inside the delay or retry logic from there it should go to end state

You need to manage the transition condition correctly for this and it will solve your problem ! :blush:

Thanks ! @Shruthika_r

to retry after 10 minutes you can go for retry scope and add 00:10:00 as time interval property of retry scope and inside the retry you can use get mail activity filter mail with subject and get the output variable of mailmessage and in condition section you can use check true to check if the mail message output is >0
you can also simply get mail and if not found use delay activity for 10 minutes and get mail again if found process it , if not throw business rule exception and sent notification to business unit or the user.

sure you can use the queue and use the attachment path where you save your attachment as queue item, which can be processed by other performer process and this is best approach.

I would suggest you to use reframework and adapt the reframework to handle that queue item even if it is one item this is best way to have exception handling and logging and many benefits of reframework

1 Like

@Shruthika_r

Yes if thats the case you can add it

What you can do is if mail is not found xan add one more new queue otem with postpone as 10 mins or directly postpone the current item to 10 mins so that t can trigger the bot in 10 mins witg quwue trigger…if auccessful add an item for next day 4am and have queue triggers enabled

This way the bot need not wait but will start again after 10 mins as the item in wueue will be available

Hope this helps

Cheers

1 Like

@Anil_G -I added delay after 1 transaction, and 1st and SE, so it is retrying after 3min.

Actually mail will be 200% there , still I am adding scenario to retry transaction, before confirming mail not received.

thanks for inputs!!

@Shruthika_r

that would still keep the bot waiting with no other processes being let moved…thats not good…but it would still serve the purpose

cheers

Or let me simply try retry scope.

TIA!

1 Like

@Shruthika_r

retry scope also would consume…

retry is just like what you are doing right now…with inbuilt delay feature

cheers

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