Lev Zemlyanov
08/12/2025, 9:15 PMMarvin
08/12/2025, 9:15 PMMarvin
08/12/2025, 9:16 PMLev Zemlyanov
08/12/2025, 9:17 PMMarvin
08/12/2025, 9:17 PMMarvin
08/12/2025, 9:20 PMprefect deployment run "flow-name/deployment-name"
or prefect deployment run --id <deployment-id>
- Python: from prefect.deployments import run_deployment; run_deployment("flow-name/deployment-name")
If you need to run different code/config “versions” side-by-side, create separate deployments with distinct names (e.g., my-deploy-v1
, my-deploy-v2
) pinned to the desired commit/image. Alternatively, re-deploy the older commit to make it the current version, then run it.
If you share your setup (source control, Docker/K8s, etc.), I can suggest a clean versioning pattern.Lev Zemlyanov
08/12/2025, 10:02 PMMarvin
08/12/2025, 10:02 PMMarvin
08/12/2025, 10:03 PMchild-flow/ingest-2025-08-12
or child-flow/ingest@abc1234
- Then your parent calls the exact versioned deployment name so parent and child stay in lockstep.
- Pass the version into the parent and construct the child deployment name dynamically:
from prefect.deployments import run_deployment
import os
release = os.environ["RELEASE_SHA"] # or a flow parameter
child_name = f"child-flow/ingest@{release}"
run_deployment(name=child_name, parameters={"x": 1})
- If you don’t need separate infra for the child, call the child flow directly as a subflow (function call). That guarantees the same code/image.
- Pin your code and container immutably (git SHA, image digest) for each versioned deployment so each is reproducible and survives future updates.
References
- run_deployment API: prefect.deployments.run_deployment
If you tell me how you’re building images and sourcing code (git, Docker/K8s), I’ll sketch a versioned deployment pattern you can drop in.