Hello! I've migrated over from Agents to Workers r...
# ask-community
c
Hello! I've migrated over from Agents to Workers recently and started using the new
prefect.yaml
file to define all my deployments... I have one question in terms of best practices... if defining a deployment
schedule
is a requirement in the
prefect.yaml
file, what is the point of editing a schedule through the UI? The UI changes won't be kept in-sync with the prefect.yaml file, because if I ever do a re-deployment of the same deployment, it will override the UI schedule with whatever is on the file.
n
hi @Carlos Cueto - defining a
schedule
should not be required for your deployments in your
prefect.yaml
. can you share the issue you ran into when not defining a schedule for your deployment?
c
@Nate If I leave the schedule property null or empty in the yaml, an empty schedule gets sent to the API. When you look at the UI, there’s no schedule.
n
hmm interesting, my prior was that if you omitted the
schedule
field entirely, then you'd keep your UI-configured schedule, but that appears to not be the case i don't see any open issues about this, but would you be willing to open an enhancement ticket for this? i'm imagining that if certain deployment fields are omitted from the deployment definition in the
prefect.yaml
but they exist in the deployment on the server, then the values in the fields that exist should remain (schedule, in this case) - does that sound like the behavior you want to see?
c
That’s exactly the behavior that I would like to see. Otherwise the Schedule UI becomes meaningless for us, that would be a shame. I’ll go ahead and open an issue for that to see what can be done.
thank you 1
👍 2
n
this may not be helpful if you need to frequently change the schedule in the UI between deployments, but in the interim could you just set the
schedule
in the
prefect.yaml
so that whenever you deploy, the UI already shows the schedule you want for that deployment?
c
That’s what we have been doing. Setting the schedule in the prefect.yaml. However, I have some team members that were used to always using the UI strictly to set schedules in the past, and now that I’ve told them they need to specifically state it on the prefect.yaml instead, they aren’t happy about that.
n
understood - thanks for the context. we'll get on the issue as soon as we can
🙌 2
c
🙏 1
👍 1