<@ULVA73B9P> ive just updated prefect server from ...
# ask-marvin
a
@Marvin ive just updated prefect server from 2.20.16 to 3.7.0. why are all my flows duplicated?
m
thought for 161.3 seconds
Most likely: what you’re seeing is not duplicate flow records, but Prefect 3 showing multiple deployments or migrated flow-related entries in a way that looks like duplicated flows. A few important points: In Prefect 3, flows are unique by name on the server side. The server model has a uniqueness constraint on
flow.name
, and flow creation is idempotent. So a true duplicate flow record with the exact same name generally should not be created during normal registration. What can make things look duplicated after a 2.x → 3.x upgrade: 1. Multiple deployments for the same flow - A single flow can have many deployments. - Depending on where you’re looking in the UI, this can look like repeated flow entries. 2. Different flow names than you expected - If your code changed how flow names are assigned, Prefect may treat them as distinct flows. - For example, renamed functions, explicitly set
@flow(name=...)
values, or environment-specific naming can create separate flow entries. 3. Upgrade-related run duplication, not flow duplication - Prefect’s upgrade guide mentions a small risk of duplicated scheduled runs right after upgrading due to scheduler/idempotency differences. - That would make the UI noisier, but it’s different from duplicate flow definitions. Docs: Upgrade to Prefect 3 A quick way to tell which case you have: If the “duplicates” have the same flow name: - check whether each one is tied to a different deployment - or whether you’re actually looking at runs, not flows If the names are slightly different: - compare your current
@flow
decorators and deployment definitions against the old 2.x code If you have DB access, this is the fastest sanity check:
Copy code
sql
SELECT name, COUNT(*)
FROM flow
GROUP BY name
HAVING COUNT(*) > 1;
If that returns nothing, then the duplicates are almost certainly a UI/viewing artifact or multiple deployments/runs, not duplicate flow rows. Since you upgraded from 2.20.16, one especially relevant thing to inspect is whether your old agent/deployment setup got replaced by new 3.x deployment patterns and now you have multiple deployments registered for the same underlying flow. If you want, send me: - a screenshot of where in the UI you see the duplicates, or - the output of
prefect deployment ls
and a couple of flow names and I can help pinpoint whether these are duplicated flows, deployments, or runs.