Skip to content

Conversation

@zzstoatzz
Copy link
Collaborator

closes #19313

this PR adds a how-to guide for automatically canceling late flow runs using Prefect automations. when a work pool is paused or workers go offline, scheduled runs can accumulate in a Late state. this guide shows how to prevent queue buildup by using an automation that cancels runs when they become late.

what's included

  • new how-to guide at docs/v3/how-to-guides/automations/cancel-late-runs.mdx
  • updated docs/docs.json to include the new page in navigation
  • demonstration script in sandbox/cancel_late_runs.py (not committed, used for verification)

the guide covers

  • creating a deployment
  • creating the automation via YAML + CLI
  • targeting specific deployments using deployment name in match_related
  • explanation of when runs become late
  • what happens when runs are cancelled

testing

verified the automation works end-to-end:

  • created test deployment and automation
  • created flow runs that became late (no worker to pick them up)
  • confirmed automation cancelled all late runs
  • tested both global (all runs) and targeted (specific deployment) configurations

🤖 Generated with Claude Code

@github-actions github-actions bot added enhancement An improvement of an existing feature docs labels Oct 31, 2025
zzstoatzz and others added 2 commits October 31, 2025 12:46
closes #19313

this PR adds a how-to guide for automatically canceling late flow runs using Prefect automations. when a work pool is paused or workers go offline, scheduled runs can accumulate in a Late state. this guide shows how to prevent queue buildup by using an automation that cancels runs when they become late.

<details>
<summary>what's included</summary>

- new how-to guide at `docs/v3/how-to-guides/automations/cancel-late-runs.mdx`
- updated `docs/docs.json` to include the new page in navigation
- demonstration script in `sandbox/cancel_late_runs.py` (not committed, used for verification)

the guide covers:
- creating a deployment
- creating the automation via YAML + CLI
- targeting specific deployments using deployment name in match_related
- explanation of when runs become late
- what happens when runs are cancelled

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@zzstoatzz zzstoatzz force-pushed the docs/cancel-late-runs branch from d04aade to 506e0c3 Compare October 31, 2025 17:47
@zzstoatzz zzstoatzz marked this pull request as draft October 31, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement An improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add feature to disallow queueing of flow runs

3 participants