Stephane Geneix
08/20/2025, 5:52 PMMarvin
08/20/2025, 5:52 PMMarvin
08/20/2025, 6:12 PMfrom prefect.flows import Flow
flow = Flow.from_source(
source="<https://github.com/org/repo@<commit-sha>>",
entrypoint="path/to/flow.py:my_flow",
)
flow.deploy(name="my-flow-adhoc-<sha>", work_pool_name="my-pool")
Then run it:
prefect deployment run "my_flow/my-flow-adhoc-<sha>"
Note: there’s no version flag on run; confirmed by:
prefect deployment run --help
References:
- Versioned deployments overview and rollback: https://www.prefect.io/blog/how-to-roll-back-deployments-in-prefect-with-deployment-versioning
- Prefect 3 how-to on deployments: https://docs-3.prefect.io/v3/how-to-guides/deployments/prefect-yaml
- Release notes introducing the feature in OSS: https://docs-3.prefect.io/v3/release-notes/oss/version-3-2
If you tell me whether you want a one-off ad-hoc run or something scheduled/repeatable, I can suggest the cleanest workflow. And yes, I also wish there were a “Run this version” button.