Hi. Sorry to ask such a basic question, but is it ...
# ask-community
t
Hi. Sorry to ask such a basic question, but is it possible to delete a flow from the prefect server? I would like to do it programmatically, but I can't find any reference to it the documentation. I also can't see this option in the prefect cloud webUI.
k
Hey @Thomas Furmston, you can use the GraphQL API like this:
Copy code
mutation {
  delete_flow(input: {flow_id: "id_here"}) {
    success
    error
  }
}
so you can use that in the Interactive API or you can use the Prefect Client
Copy code
from prefect.client.client import Client
Client.graphql(query)
t
ok, thanks
I've not use GraphQL before, but it looks simple enough
to make sure I understand,
query
in
Client.graphql(query)
would be some GraphQL query, right?
k
Yes actually it would be
Copy code
client = Client()
client.graphql(query)
Where query is a string so you can wrap the whole mutation query is a string
t
ok, cool
thanks!