<@ULVA73B9P> can I delete a specific flow run and ...
# ask-marvin
h
@Marvin can I delete a specific flow run and all its subflows with python
m
Yes, you can delete a specific flow run and all its subflows using Python. However, there isn't a direct method to delete a flow run and all its subflows. You would need to manually delete each flow run. Here's an example of how you can delete all flow runs using the Prefect CLI:
Copy code
❯ prefect flow-run ls | awk 'NR>3 {print $2}' | while read line
do
    prefect flow-run delete $line
done
This command lists all flow runs, extracts the flow run IDs, and then deletes each flow run. As for deleting subflows, they are just flows called from within a flow. So, you would need to delete them as you would delete any other flow. Please note that this operation should be used with caution as it will permanently delete the flow runs and cannot be undone.