Hi there, apart from GUI, how do I remove/delete o...
# prefect-server
c
Hi there, apart from GUI, how do I remove/delete one/multiple flows? e.g. via CLI, Python etc.
k
You need to use the GraphQL API like:
Copy code
mutation {
  delete_flow(input:{flow_id: "171bb895-f94e-4d9d-9e86-7370b743a285"}) {
    success
  }
}
c
@Kevin Kho apart from GraphQL, is there any other way? specifically way that can be scripted
I saw that we can use Python script to interact with GraphQL https://docs.prefect.io/orchestration/concepts/api.html#client, is there a way to delete flow just by specifying its name but not its id?
a
You could first query for flows and their IDs, and use it as input to the delete_flow mutation. You can definitely script that in Python but there is no way to bulk delete things from the CLI or UI, other than perhaps delete an entire project and all flows within a project.
c
@Anna Geller so there re no CLI way to delete flow?
k
There is none. Just projects. We’d definitely welcome a PR for that though