How to stop workflow if no unread mail

I want to stop my workflow if there is no unread mail in inbox. My workflow still exeuting if thete is no unread mail

use the ‘Terminate Workflow’ activity

1 Like

If you are using any Loop activity, you exit by using Break Activity.

Hey @NagaSujitha

What Layout you are using Flowchar or Statemachine?
Both are good to handle your simple scenario.

Or Reframework :wink: Too.

I do not want to use Terminate workflow because it does not shut down a bot in a graceful manner :slight_smile:


While using Terminate, What will be reason or exception condition

I am using Flowchart method, Some how i can unable to stop workflow if no unread mail
now i want to send mail as there is no new mail
In Work flow first used get mail to read only unread mail, if unread mail exit perform next step “read mail loop” and stop workflow, it should not go to send mail
if no unread mail exit perform send mail activity

Hey @NagaSujitha

use Flow Decision activity after Get outlook mail message and in condition check for the count. if there is anything then go to Yes branch else go to No branch.


Thank you its worked :slightly_smiling_face:

I am not expert in coding just want to clarify will below condition is correct for checking multiple and condition in do while

“Loading=false andalso Failed = true and intLoad>0”

Here : Loading, Failed and intLoad are variables