https://prefect.io logo
Title
r

Ruggiero Dargenio

07/29/2022, 6:50 PM
Hi everybody! Just started recently using Prefect and it looks great! I have a simple question which I am finding hard to find the solution. If I have a flow with a schedule, say every minute, what is the proper way to stop that flow to run and all the following runs? Maybe using states?
1
b

Bianca Hoch

07/29/2022, 6:58 PM
Hello Ruggiero, here's a helpful article for cancelling several flow runs https://discourse.prefect.io/t/how-can-i-cancel-several-submitted-flow-runs-at-once/751
r

Ruggiero Dargenio

07/29/2022, 7:20 PM
Hi Bianca, I am not sure this solves my issue. I'd like Prefect to automatically stop running the schedule of the flow once a certain exception happen without manual intervention
b

Bianca Hoch

07/29/2022, 7:35 PM
Ah, thank you for clarifying. You should be able to use states to handle that. Are you using 1.0 or 2.0?
r

Ruggiero Dargenio

07/29/2022, 7:37 PM
1.0
Is there any documentation or post on how to stop subsequent runs of a flow with a IntervalSchedule in a state handler?
The thing is that as far as I understand a state is a property of a run not of the flow. So I am not sure how to stop all the subsequent runs of a flow with a schedule using states. Maybe there is another way?
j

James Sopkin

07/29/2022, 7:55 PM
Hi @Ruggiero Dargenio so i believe what you are asking for is a cancellation of a schedule given that a flow fails? You should be able to achieve this with automations https://docs-v1.prefect.io/orchestration/concepts/automations.html#events-reference
minor correction- the automation will allow you to pause a schedule
r

Ruggiero Dargenio

07/29/2022, 7:59 PM
Hi James thank you, this at first glance is what I was looking at. Is there a way also to do it with core or is only a Cloud feature? At the moment I was experimenting locally
j

James Sopkin

07/29/2022, 8:03 PM
It would be a feature only available on cloud. I'm not sure if there is an alternate way to do this locally