https://prefect.io logo
#prefect-community
Title
# prefect-community
t

Tony Yun

04/11/2022, 7:48 PM
hi, is there a way that we can turn off/on a flow schedule from running a CLI command?
k

Kevin Kho

04/11/2022, 7:50 PM
Not with the Prefect library. You could try doing a cURL statement that hits the graphQL API? The syntax is pretty hard to get right though
t

Tony Yun

04/11/2022, 7:51 PM
Got it. Just want to confirm if there is an easy way. In that case I’ll give up quick then 😂
a

Anna Geller

04/11/2022, 11:58 PM
if you don't mind your flow version being incremented, you could reregister your flow and disable the schedule while doing that, all from CLI:
Copy code
prefect register --project my-project -p flow.py --no-schedule
t

Tony Yun

04/12/2022, 2:54 PM
Thanks @Anna Geller, that sounds doable to me too. But given I’m thinking to do it in CI/CD pipeline, that might blow off the version number to make any sense 😅
a

Anna Geller

04/12/2022, 2:57 PM
not necessarily - if you register using CLI, by default Prefect won't bump up the flow version if the flow metadata hasn't changed. This topic explains what is flow metadata and when the version gets incremented
t

Tony Yun

04/12/2022, 3:03 PM
oh i see. thanks for sharing!
👍 1
7 Views