Skip to content

fix: Add batch delete and cancel support for flow runs#22279

Open
hemantmm wants to merge 4 commits into
PrefectHQ:mainfrom
hemantmm:flow-run-batch-delete-cancel
Open

fix: Add batch delete and cancel support for flow runs#22279
hemantmm wants to merge 4 commits into
PrefectHQ:mainfrom
hemantmm:flow-run-batch-delete-cancel

Conversation

@hemantmm

Copy link
Copy Markdown
Contributor

closes: #19904

Adds support for batch operations for flow runs by allowing multiple flow run IDs to be passed to the CLI commands.

Before:
prefect flow-run delete id1
prefect flow-run delete id2
prefect flow-run delete id3

After:
prefect flow-run delete id1 id2 id3

Screenshot 2026-06-15 at 18 55 41 Screenshot 2026-06-15 at 18 54 43
@github-actions github-actions Bot added cli Related to the Prefect CLI enhancement An improvement of an existing feature labels Jun 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb5511d7a5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"""Cancel a flow run by ID."""
flow_run_ids = list(ids)

if sys.stdin:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Honor --stdin before reading standard input

When prefect flow-run cancel <id> is run from an interactive terminal without --stdin, sys.stdin is still truthy, so this loop waits for EOF before any cancellation occurs; with piped input it also consumes and parses unrelated stdin as UUIDs. Gate this block on the stdin option, matching the new delete command behavior, so the normal cancellation path does not block or read unexpected input.

Useful? React with 👍 / 👎.

Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
@codspeed-hq

codspeed-hq Bot commented Jun 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 8 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing hemantmm:flow-run-batch-delete-cancel (5a1619d) with main (e948a74)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

hemantmm added 2 commits June 15, 2026 19:26
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
@hemantmm

Copy link
Copy Markdown
Contributor Author

@desertaxle, can you review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the Prefect CLI enhancement An improvement of an existing feature

1 participant