https://prefect.io logo
d

Dotan Asselmann

02/21/2022, 12:09 PM
Hey! How can i use GraphQL mutation to delete prefect flow run logs by flow run id? an example would be appreciated!
a

Anna Geller

02/21/2022, 12:22 PM
You can do it this way:
Copy code
from prefect import Client

flow_run_id = "paste UUID here"
client = Client()
client.graphql(
    {
        "mutation": {
            'delete_flow_run(input: {flow_run_id: "'
            + flow_run_id
            + '"})': {"success", "error"}
        }
    }
)
And if you need it to clean up space in Prefect Server database, check out this thread
d

Dotan Asselmann

02/21/2022, 2:44 PM
Thank you. i did that and deleted a lot of flow runs but it seems like the storage is unchanged [even grew a bit]
any idea what it could be?
a

Anna Geller

02/21/2022, 2:47 PM
Nope, it shouldn't. But you can also check this thread if you want to save Postgres space for Server
9 Views