PrefectHQ
prefect
BlogDocsChangelog

Add bulk delete endpoint for flow runs

#19232
Comparing
backport/flow-run-bulk-delete
(
f98e75f
) with
main
(
9bae64b
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
460.1 µs458.3 µs
bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s

Ignored

bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-3%
4.4 ms4.5 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-1%
105.3 ms106.1 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
+5%
171.2 ms162.8 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+21%
5.3 ms4.4 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1 s1 s
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+1%
164.4 ms163.5 ms

Commits

Click on a commit to change the comparison range
Base
main
9bae64b
-0.02%
Add bulk delete endpoint for flow runs adds a bulk delete endpoint for flow runs using the same filter used by the `POST /filter` read endpoint ### key features - **filter-based deletion**: uses the standard `FlowRunFilter` for maximum flexibility - delete by IDs, states, tags, or any criteria - **batch processing**: processes flow runs efficiently with proper resource cleanup - **background log cleanup**: schedules log deletion as background tasks to avoid blocking the response ### api - **endpoint**: `POST /flow_runs/bulk_delete` - **request body**: - `flow_runs`: standard `FlowRunFilter` object (e.g., `{"id": {"any_": [id1, id2]}}`) - `limit`: maximum number of flow runs to delete (1-200, default: 200) - **response**: `FlowRunBulkDeleteResponse` with deleted flow run IDs ### implementation - reuses existing `FlowRunFilter` schema - the same filter used for querying flow runs - uses hard deletion (unlike cloud's soft deletion) - properly handles concurrency slot cleanup - background tasks handle log deletion šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
0899389
11 days ago
by zzstoatzz
+0.14%
Add comprehensive tests for bulk delete endpoint - test_bulk_delete_by_ids: Tests deletion by specific flow run IDs - test_bulk_delete_by_tags: Tests deletion by tag filtering - test_bulk_delete_limit: Tests that the limit parameter is enforced - test_bulk_delete_validation: Tests parameter validation - test_bulk_delete_with_concurrency_slots: Tests concurrency slot cleanup All tests pass āœ… šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
412e432
11 days ago
by zzstoatzz
+0.11%
Remove type hints from test fixtures Following project convention - test fixtures don't have type hints šŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
f98e75f
11 days ago
by zzstoatzz
Ā© 2025 CodSpeed Technology
Home Terms Privacy Docs