<@ULVA73B9P> What happens if have already created ...
# ask-marvin
r
@Marvin What happens if have already created deployments, and then I change the inputs of one flow. Then I redeploy the deployments. Does prefect will update the deployment if there's already one with the same name ? Will it create another one with the same name ?
m
thought for 226.0 seconds
Short answer: Prefect will update the existing deployment (it won’t create a duplicate) as long as it’s the same flow and the same deployment name. Details: - Uniqueness: In Prefect 3.x, deployments are uniquely identified by the pair (flow, deployment name). You can have multiple deployments per flow, but each must have a unique name for that flow. - Redeploy behavior: Running
prefect deploy
or
flow.from_source(...).deploy(name=...)
with the same flow and deployment name will upsert the deployment—i.e., update it and create a new deployment version rather than making a duplicate. - Versioning: Each update creates a new version you can view (and roll back to) in the UI. - Schedules: On upsert, Prefect clears any future scheduled runs for that deployment and re-creates them based on the new config. - Parameter (inputs) changes: The deployment’s parameter schema is updated. If
enforce_parameter_schema
is true (default), runs that don’t match the new schema will fail validation. Update default parameters in the deployment if needed. If you actually want a second deployment to coexist, just give it a different deployment name. Refs: - Deployments overview: Concepts: Deployments - Versioning behavior: How-to: Deployment versioning - API upsert semantics: Create deployment API (upsert behavior) Quick follow-up: when you say “change the inputs,” are you changing the flow function’s parameter list/annotations, or just the default parameters saved on the deployment? This affects whether you’ll want to adjust the deployment’s saved parameters too.