hi everyone! i'm looking for a way to clear up old...
# prefect-getting-started
l
hi everyone! i'm looking for a way to clear up old local flow runs (+ artifacts + task runs..) from my postgres. ideally once a day delete anything older than a couple of days anyone have any experience with this? also, if I delete a flow run does it delete all the nested stuff in the DB?
b
Hey Lior! You should be able to use the python API to get this done. Here is an example which deletes flow runs with a certain state https://discourse.prefect.io/t/how-to-bulk-delete-flow-runs-in-a-certain-state-with-the-api/2247
For artifacts and Task runs, I think you'll need to expand the request a bit more. Should be absolutely doable though
l
amazing! thanks!