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

Joshua Greenhalgh

04/28/2022, 2:12 PM
Is there a way to have a schedule on a flow but for it to be turned off by default?
Usecase - is a dev env where never want things running without an explicit trigger
Althoug the actual flows should
I suppose could just switch on an env var
schedule=CronSchedule("0 11 * * *") if ENV_VAR else None
,
rubber duck
k

Kevin Mullins

04/28/2022, 2:21 PM
When registering flows you can choose whether or not to schedule it (this is what I do). From the cli this is
--schedule / --no-schedule
and if you are using flow.register it is
set_schedule_active
https://docs.prefect.io/api/latest/cli/register.html https://docs.prefect.io/api/latest/core/flow.html#flow-2
upvote 2
a

Anna Geller

04/28/2022, 3:48 PM
are you asking for Prefect 2.0 or 1.0?
10 Views