Christopher Chong Tau Teng

    Christopher Chong Tau Teng

    8 months ago
    Hi there, apart from GUI, how do I remove/delete one/multiple flows? e.g. via CLI, Python etc.
    Kevin Kho

    Kevin Kho

    8 months ago
    You need to use the GraphQL API like:
    mutation {
      delete_flow(input:{flow_id: "171bb895-f94e-4d9d-9e86-7370b743a285"}) {
        success
      }
    }
    Christopher Chong Tau Teng

    Christopher Chong Tau Teng

    8 months ago
    @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?
    Anna Geller

    Anna Geller

    8 months ago
    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.
    Christopher Chong Tau Teng

    Christopher Chong Tau Teng

    8 months ago
    @Anna Geller so there re no CLI way to delete flow?
    Kevin Kho

    Kevin Kho

    8 months ago
    There is none. Just projects. We’d definitely welcome a PR for that though