Hi, I'd like to register a flow multiple times wit...
# prefect-server
a
Hi, I'd like to register a flow multiple times with a different schedule and parameters for each one. Is this possible? I can see from this page in the docs it’s possible to set a start time, but no schedule.  The reason is that we're investing creating a single generic flow that can handle different source data based on input parameters.
k
Hi @Andrew Moist, you can attach multiple Clocks to a Schedule like this:
Copy code
clock1   = clocks.IntervalClock(...)
clock2   = clocks.CronClock(...)

# the full schedule
schedule = Schedule(clocks=[clock1, clock2])

flow.schedule = schedule
You can also use the GraphQL to set it up like this .
z
I had a similar use case and had to get creative and used jinja templating, worked very well. Parameters weren’t working exactly right for what I needed to get done. We then run some codegen using jinja as part of our CI pipeline. You could also just get a cron schedule from an env variable or perhaps use prefect’s built in templating like this https://docs.prefect.io/core/concepts/templating.html#what-variables-can-i-use
a
@Kevin Kho Thanks, I'll have a play with the GraphQL example you provided. @Zach Schumacher Yes, our team have also been discussing using jinja templating, although it feels like the wrong solution... just looking for a cleaner solution.