<@ULVA73B9P> when a Prefect deployment is deleted,...
# ask-marvin
n
@Marvin when a Prefect deployment is deleted, is the history of runs deleted as well?
m
thought for 74.4 seconds
No — deleting a deployment does not delete its run history. In Prefect 3.x, the behavior is: - Past runs are retained - Running runs are retained - Scheduled, not-yet-started runs for that deployment are deleted So the deployment goes away, but most historical flow runs remain in the database/UI as historical records. A useful nuance: those retained runs become effectively disassociated/orphaned from the deleted deployment, since the deployment record is gone. I verified this from Prefect 3.x server code: - Deployment deletion logic deletes scheduled runs before deleting the deployment - Flow runs are not cascade-deleted by
deployment_id
Relevant source references: - Deployment deletion logic: `src/prefect/server/models/deployments.py` - Flow run ORM model: `src/prefect/server/database/orm_models.py` If you want, I can also tell you what this looks like in the UI/API after deletion, or how this differs from deleting a flow instead of a deployment.