<@ULVA73B9P> I have a list of schedules for a depl...
# ask-marvin
p
@Marvin I have a list of schedules for a deployment. Is it possible to have different set of parameters for each schedule?
m
Yes, it is possible to have different sets of parameters for each schedule in a Prefect deployment. ### Deployment Schedules in Prefect: In Prefect, you can define multiple schedules for a deployment, and each schedule can have its own set of parameters. This can be accomplished by defining your deployment configuration in a
prefect.yaml
file. Here's a general structure to include different schedules with different parameters:
Copy code
yaml
deployments:
- name: my-deployment
  flow: my_flow.py
  parameters:
    param1: default_value
  schedules:
  - cron: "0 0 * * *"
    timezone: "America/Chicago"
    parameters:
      param1: value_for_cron_A
  - cron: "0 12 * * *"
    timezone: "America/New_York"
    parameters:
      param1: value_for_cron_B
### Example: Here’s an expanded example to illustrate how you might set this up: 1. Define your flow in `my_flow.py`:
Copy code
python
    from prefect import flow

    @flow
    def my_flow(param1):
        print(f"Running my flow with param1 = {param1}")

    if __name__ == "__main__":
        my_flow()
2. Define your `prefect.yaml`:
Copy code
yaml
    deployments:
    - name: my-deployment
      flow: my_flow.py
      parameters:
        param1: "default"
      schedules:
      - cron: "0 0 * * *"
        timezone: "America/Chicago"
        parameters:
          param1: "chicago_value"
      - cron: "0 12 * * *"
        timezone: "America/New_York"
        parameters:
          param1: "ny_value"
### Reference: You can find more details about configuring deployment schedules in the Prefect documentation here: Prefect Schedules. If you have any more questions or specific use cases, feel free to ask.
n
marvin gets confused at this question, parameters is not included in the definition of schedules like that short answer is no (not like prefect 1 anyways) there's more we'd like to do to make this easier, but an easy workaround right now is just to create an independent deployment per schedule / unique parameter set
1
p
Thanks yeah I had the same understanding
👍 1