<@ULVA73B9P> If I have a deployment scheduled (i.e...
# ask-marvin
a
@Marvin If I have a deployment scheduled (i.e. recurring with cron through prefect cloud) and I re-publish this deployment - will it use the most recent version ? Is there a way to view the version ?
m
thought for 338.2 seconds
Short answer - Yes — when you republish a deployment in Prefect Cloud (Prefect 3.x), future scheduled runs will use the most recent deployment version. Prefect deletes pending auto-scheduled runs and regenerates them from the updated deployment, so the cron schedule picks up the new version going forward. Already running or previously created runs keep the version they were created with. - You can view the deployment version in the UI, via the CLI, or via the Python client. How to view the version - Prefect Cloud UI - Open the Deployment page. You’ll see the current version, and (in Cloud) a history of versions with options to promote/rollback. - Individual Flow Run pages also show which deployment version that run used. - CLI - Inspect a single deployment:
Copy code
prefect deployment inspect "flow-name/deployment-name"
- List deployments (JSON output makes it easy to see the version field):
Copy code
prefect deployment ls -o json
- Python client
Copy code
from prefect.client.orchestration import get_client

  async def show_version():
      async with get_client() as client:
          dep = await client.read_deployment_by_name("flow-name/deployment-name")
          print(dep.version)       # user-supplied version string (if set)
          # In Cloud you’ll also see:
          # dep.version_id, dep.version_info
If you want, tell me your deployment name and I can share the exact CLI/API call tailored to it.