You may have a job that you only want to run one at a time. For example, it may be a job that is set to run once an hour from a schedule, but sometimes you want to run it manually. If you started it manually and it is still running when the schedule triggers, you want the manual one to keep running, but you do not want the scheduled one to run. Or, the situation may be reversed, you may start it manually when it is already running from the schedule.
To address this, add a step to the beginning of your Procedure that will scan for existing jobs that are running of the same "type". In the example below, the "type" is based on the Project name and Procedure name, but you can customize the step to include additional criteria, such as a special property.
This example also does some extra cleanup. It finds and removes old jobs that were terminated by this mechanism so that they do not clutter your reports, and so on. It also cleans up their workspaces.
Create a step like this at the beginning of your main procedure in your environment:
Name: Check For Running Jobs
Error Handling: Abort entire job and terminate running steps
The exit 1 will cause the job to fail and skip the rest of the steps if there is another job running with the same Project/Procedure. This would be a good candidate to put into a shared library and call it as a function.