Hello, I wanted know if there a way to pause the f...
# ask-community
c
Hello, I wanted know if there a way to pause the flow schedule and delete flow. I tried looking into docs but couldn't find anything(may be I missed something). I can delete the flow and stop the schedule using UI, but I need something by which I do it from code itself.
I'm creating the and starting flow like this
Copy code
with Flow("start flow"), schedule=schedule) as f:
     start_task()

flow_id = f.register(project_name="project")
client.create_flow_run(flow_id=flow_id)
now I'm looking for something like below to pause schedule
Copy code
client.pause_schedule(flow_id)
and something like this to delete the flow
Copy code
client.delete_flow(flow_id)
I tried
client.set_flow_run_state(flow_run_id, Cancelled())
but it cancels the current flow run only and runs the next scheduled flow.
k
Hey @Chhaya Vankhede, you need to use the
set_schedule_inactive
mutation in the graphQL API. It will take in a flow_id like this .
Copy code
mutation {
  set_schedule_inactive (input: {flow_id: "bcde92fd-0e8a-4a79-9583-5bdf662d9f5f"}) {
    success
  }
}
For deleting, you want
archive_flow
c
Cool, thank you!