Scheduled deployment triggers in Octopus (https://octopus.com/docs/projects/project-triggers/scheduled-deployment-trigger) solely queue a deployment, they do not perform any checks, so, as you are probably encountering if the project is already running, a deployment task will be queued.
One way to avoid this is to have two projects. Let’s call the project that does the actual (potentially long-running) work, that you want to run on a schedule
ChildProject and the second
ParentProject will have a script step which checks to see if the
ChildProject is currently running for the current Environment, if it is not, it creates a deployment for
ChildProject for the current Environment. Because the
ParentProject will take seconds to complete, we avoid project deployments queuing up.
ChildProject runs a Powershell Sleep for 3 minutes, and there is a scheduled deployment trigger for
ParentProject that triggers a deployment every 2 minutes. In this example it will be quite common that
ChildProject will not be deployed.
In the image above, we can see that
ParentProject ran on the schedule and that on the 2:20 PM deployment it found the
ChildProject was already executing, so did not create a new deployment for it.
A script to use in the script step of the
ParentProject can be found here: https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/Octopus.Client/PowerShell/Deployments/CreateProjectDeploymentIfNotRunningAlready.ps1
You can parameterize the environment and project to deploy.