Hi all, is there a way to create a deployment and ...
# prefect-cloud
m
Hi all, is there a way to create a deployment and set it on schedule using custom parameters? For example, I've deployed a flow with default parameters (like below) and scheduled run would use these defaults, and I know I have the option to make a custom flow run by overriding these default parameters. But can I make another deployment that would override these default parameters and set that on schedule as well, without changing my code?
c
Hi Moe! Yes, definitely, this is a very common use case for
Deployment
. When you create your deployment with
prefect deploy
, you can pass either the
--param
or
--params
option on the CLI.
Copy code
prefect deploy --param first=1 --param second=2 ...
or
Copy code
prefect deploy --params '{"first": 1, "second": 2}' ...
These deployment parameters will be captured in the
prefect.yaml
file in your project as well, and you can edit them there after the fact.
You can make as many deployments of a flow as you need, and each deployment can have multiple schedules and/or event triggers to initiate them
m
@Chris Guidry Ty