https://prefect.io logo
Title
s

Sylvain Hazard

02/02/2022, 10:15 AM
Hey there ! Starting to try out GraphQL (first time 😬) to clean up old flow runs in order to reduce the size of Postgre Database. I manage to get flow run ids before a given date as well as deleting a single flow run from its id using
delete_flow_run
but is there a way to delete multiple flow runs at once ? Thanks !
a

Anna Geller

02/02/2022, 10:32 AM
There is not. I think the only way would be to delete the entire project
p

Prasanth Kothuri

02/02/2022, 10:33 AM
@Sylvain Hazard I made a script, let me share that with you
:upvote: 1
this one will delete all flow runs older than 30 days, change 30 to whatever is good for you
s

Sylvain Hazard

02/02/2022, 10:39 AM
That's amazing, thank you so much !
a

Anna Geller

02/02/2022, 1:39 PM
@Marvin archive ā€œDelete old flow runs older than 30 days using GraphQL API to clean up Server resourcesā€ in server