Pooyan
06/18/2024, 6:32 PMMarvin
06/18/2024, 6:32 PMprefect.yaml
file.
Here's a general structure to include different schedules with different parameters:
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`:
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`:
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.Nate
06/18/2024, 6:38 PMPooyan
06/18/2024, 6:39 PM