How can I exit from a Notebook which is used as a job?

User16301465121
New Contributor

How can I quit from a notebook in the middle of an execution based on some condition?