Kartik
11/07/2025, 7:17 AMMarvin
11/07/2025, 7:17 AMMarvin
11/07/2025, 7:25 AMversion: null in a deployment just means you haven’t provided a version string for that deployment. It’s optional metadata and has no impact on scheduling, triggering, or worker execution.
Key points:
- What it is: A human-readable label for the deployment (e.g., a git SHA, tag, or “v1.2.3”) to help you track what code/config was deployed and to browse/rollback in version history.
- When it’s null: You didn’t set it. Prefect may infer one at deploy time:
- If you’re in a Git context, Prefect will typically use the first 8 chars of the current commit SHA.
- Otherwise it may fall back to your flow’s version (from @flow(version="...")) or a file hash.
- What it’s not: It does not affect runs, schedules, or workers. It’s purely informational.
- Related fields: version_type and version_info can capture structured details (e.g., VCS provider, commit, branch). You can leave them alone unless you want to control how version info is detected.
How to set it explicitly:
- Via Python
from prefect import flow
@flow
def my_flow():
...
my_flow.from_source("<https://github.com/org/repo>", "flows/my.py:my_flow").deploy(
name="prod",
version="2025.11.07", # any string you like
)
- Or set a flow version that Prefect can use as a fallback:
@flow(version="v1.2.3")
def my_flow():
...
Docs:
- Deployments overview
- Deployment versioning guide
If you’d like, tell me how you’re creating deployments (CLI or Python) and whether you want to use git tags/SHAs or a custom scheme—I can show the exact steps.