To cancel all late runs of a work queue in Prefect 3.x, you can utilize the Prefect CLI or API to manage flow runs. Here's a general approach:
1.
Identify Late Runs: First, you need to identify which runs are late. This can be done by querying the Prefect API for runs that have exceeded their expected start time.
2.
Cancel Runs: Use the Prefect CLI or API to cancel these identified runs. Unfortunately, the specific command to cancel late runs isn't directly mentioned in the documentation I found, but you can cancel runs by their IDs.
Here is a basic conceptual outline:
- Query for flow runs that are in a state indicating they are late (e.g., still in a pending state past their scheduled start time).
- Use the
prefect flow-run cancel <FLOW_RUN_ID>
command to cancel each identified run.
For more detailed instructions, you may need to explore the Prefect API or CLI documentation further:
Prefect Cancel Documentation.
If you have specific requirements or need further assistance, let me know!