Thomas Furmston

    Thomas Furmston

    11 months ago
    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.
    Kevin Kho

    Kevin Kho

    11 months ago
    Hey @Thomas Furmston, you can use the GraphQL API like this:
    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
    from prefect.client.client import Client
    Client.graphql(query)
    Thomas Furmston

    Thomas Furmston

    11 months ago
    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?
    Kevin Kho

    Kevin Kho

    11 months ago
    Yes actually it would be
    client = Client()
    client.graphql(query)
    Where query is a string so you can wrap the whole mutation query is a string
    Thomas Furmston

    Thomas Furmston

    11 months ago
    ok, cool
    thanks!