Hi I new here, so I need to iterate through mail and check their subject if the subject is "Invoice I need to proceed further or else I need to throw an error after loop is completed I already created workflow but its not working when email subject is dif

@Simran2 ,

As per your Workflow out of 10 Emails even if 1 Email contains required Subject it will not go to else part and throw the exception.

Out of N Emails even if 1 contains invalid and if u need to throw exception in this case you need to reverse the condition in 1st If - Else block.

Assign Boolean = True in else block (which means Invalid Email found)

In 2nd If - Else block if your Boolean is true throw exception.
This way it will throw exception even if 1 Invalid found.

But not sure what is your need here, this suggestion is based on your workflow.

Hope it helps!

Regards,
Rohith