Canceling runs in different states with a push policy

Last updated: September 16, 2025

The "Cancel In-Progress Runs" policy from the policy library can be used to cancel runs in multiple states, not just queued runs. By default, the policy targets runs in the queued state, but it can be modified to work with runs in any in-progress state.

How the policy works

The policy can cancel runs that are in the in_progress queue, which includes:

  • Queued state

  • Ready state

  • Waiting for human confirmation state

Modifying the policy for all in-progress states

To cancel runs in any in-progress state (not just queued), you can remove the queued condition from the policy:

cancel[run.id] {
  run := input.in_progress[_]
  run.type == "PROPOSED"
}

This modified version will cancel runs at any stage that is in the in_progress queue.

When runs get stuck in queued state

Runs typically move quickly from queued to ready state unless there are specific policies in place. For example, if you have an approval policy configured, it can stop runs at the queued state and prevent them from moving forward to the ready state.

For more information about canceling in-progress runs, see the official documentation.