<@ULVA73B9P> When utilizing Deployment.build_from_...
# ask-marvin
w
@Marvin When utilizing Deployment.build_from_flow, it is possible to use the load_existing option to preserve the existing schedules. How can I achieve the same using prefect.yaml? I want to make the deployment while preserving the existing schedules.
m
The Prefect documentation does not provide a direct equivalent to the
load_existing
option in
prefect.yaml
, which means you can't directly preserve existing schedules via
prefect.yaml
. However, you can explicitly define schedules within the YAML file like so:
Copy code
deployments:
  - name: your-deployment
    schedules:
      - cron: "0 0 * * *"
        timezone: "America/Chicago"
        active: false
      - cron: "0 12 * * *"
        timezone: "America/New_York"
        active: true
      - cron: "0 18 * * *"
        timezone: "Europe/London"
        active: true
The lack of the
load_existing
parameter means you must manually define or copy the existing schedules you want to preserve. For more details, check the links below: - https://docs.prefect.io/latest/concepts/schedules/ - https://docs.prefect.io/latest/guides/prefect-deploy/ You might want to regularly update your
prefect.yaml
to reflect any changes in schedules manually.
a
are you being bit by https://github.com/PrefectHQ/prefect/issues/14973 @William Jamir?
w
Hi @Alexander Azzam! I dont think is quite the same issue, my schedule was enabled. We recently switched from Deployment.build_from_flow to prefect.yaml and perviously the schedules were kept untouched. But now with prefect.yaml they are erased. Is this the expected behavior indeed? I was expecting to make a deploy using prefect.yaml and being able of keeping custom changes made before.