prefect icon indicating copy to clipboard operation
prefect copied to clipboard

Schedule slug name change causes multiple schedules to be created

Open robfreedy opened this issue 1 month ago • 2 comments

Bug summary

When the slug name is changed for a schedule on a deployment, a separate schedule is created on the deployment without replacing the original schedule, so you end up with duplicate schedules.

Python code

    minute_flow.from_source(
        source=str(Path(__file__).parent),
        entrypoint="flow.py:minute_flow",
    ).deploy(
        name="minute-deployment",
        work_pool_name="local-work",
        schedule=Cron("10 * * * *", slug="robs-test")
    )

Schedule created with original slug: Image

After updating slug name to "robs-test-2" Image

Version info

Version:              3.4.25
API version:          0.8.4
Python version:       3.13.5
Git commit:           8a37e7b1
Built:                Thu, Oct 23, 2025 07:58 PM
OS/Arch:              darwin/arm64
Profile:              prefect-cloud
Server type:          cloud
Pydantic version:     2.12.3
Server:
  Database:           sqlite
  SQLite version:     3.49.1

Additional context

No response

robfreedy avatar Oct 28 '25 19:10 robfreedy

I’d like to work on this. I’ll reproduce the duplicate-schedule behavior locally, identify whether server code or client deploy logic is creating duplicate schedule rows, and propose a fix + tests. Please assign if helpful.

Faith

Faitholo avatar Nov 09 '25 12:11 Faitholo

We also suffer from this. Any update on when it will be fixed?

zacharymostowsky avatar Nov 13 '25 14:11 zacharymostowsky

The slug is used to coordinate between the Python SDK and the API to ensure that the client doesn't clobber any schedules that were created by another client (e.g. the UI). In general, we don't recommend changing the slugs of schedules after creation because those are intended to be a stable reference. If folks are interested in adding a human-friendly display name to schedules, then that might be a good way to have our cake and eat it too.

desertaxle avatar Dec 15 '25 21:12 desertaxle