We would like to schedule flows to run at interval...
# ask-community
t
We would like to schedule flows to run at intervals, but we want the same flow to run (say every day) with different parameters. The Prefect 2/3 UI does not offer the ability to define flow parameters (like “Custom Run”) . I would like to be able to specify the parameters when defining the scheduled runs. Here are the (bad) options that I see: 1. Define multiple deployments with different default parameters in prefect.yaml for each “type” of scheduled run. This doesn’t scale very well - we have N different “environments” we want to target our flows agains (dev, stage, prod, etc) and have them run at different intervals, so this adds N deployments for essentially the same thing. 2. Create a “Scheduler” deployment that executes a “flow” that calls
prefect_client.create_flow_run_from_deployment()
for each of the parameter sets. This is what we currently do, but it really feels like a hack and requires a code change/redeploy for any adjustments when the Prefect UI is way easier to use. Any other ways around that people are using? I was hoping that Prefect 3 would fix this (it does not), but this seems like an obvious required feature. Am I missing something?
1
b
Hi Tom, IMO option 2 appears to be the most viable option (if you don't want to deal with many deployments of the same flow). Your request sounds like the one described in this issue. Can you +1 and subscribe to it? I'll raise internally, since this seems like a popular request.
t
Thanks Bianca, yes #2 is what we are doing, but we don’t like it. 🙂. Will +1 the issue and watch it
🙌 1
gratitude thank you 1