Hi all, I wonder if setting up a schedule for the ...
# prefect-community
a
Hi all, I wonder if setting up a schedule for the flow is possible via a Parameter. I have a piece of code that I would like to run with different helper files on different schedules -- and I don't know if doing something like
flow.schedule = daily_schedule if daily else monthly_schedule
is acceptable inside the Flow itself, or is it better to do something outside it instead. Thanks!
upvote 1
c
Hey @Arsenii - there are a few options that you could implement right now: - register two distinct flows with different schedules and different default parameter values for your files - craft a custom schedule that uses multiple clocks to run one flow on a “union” of the schedules. Then have a root task which looks at what the scheduled start time it is and decides which file should be processed There might be another option but those come to my mind first. We have had some internal discussions on implementing a feature that would allow you to have schedule-dependent default values for Parameters which I believe would satisfy your use case, but we haven’t begun work on it yet
a
Hey, @Chris White! Yes, it seems like for now a certain amount of code duplication is unavoidable -- I don't really like the alternative of a centralized "master schedule", it would destroy the logging in Cloud UI. I'll see what I can do! Thanks!!