Madushan Pathirana
08/29/2025, 9:03 PMMarvin
08/29/2025, 9:03 PMMarvin
08/29/2025, 9:11 PMparameters
and flow_run_name
in the payload.
- Example:
curl -X POST "$PREFECT_API_URL/deployments/<deployment_id>/create-flow-run" \
-H "Content-Type: application/json" \
-d '{
"parameters": {
"env": "prod",
"customer_id": 1234,
"run_date": "2025-08-29"
},
"flow_run_name": "prod-customer-1234-2025-08-29"
}'
Docs:
- REST: create flow run from deployment
- If you are creating a run without a deployment, use the flow-runs endpoint which accepts name
instead of `flow_run_name`: REST: create flow run
2) Trigger via Python SDK
- Use prefect.deployments.run_deployment
and pass `flow_run_name`:
from prefect.deployments import run_deployment
params = {"env": "prod", "customer_id": 1234, "run_date": "2025-08-29"}
flow_run = await run_deployment(
name="my-flow/my-deployment",
parameters=params,
flow_run_name=f"{params['env']}-customer-{params['customer_id']}-{params['run_date']}",
)
print(flow_run.name)
Notes:
- The flow_run_name
you pass when creating the run will override any default run name defined in the flow or deployment.
- If you use the non-deployment flow run creation endpoint, the field is name
(not flow_run_name
), and you also need to provide flow_id
(or use a deployment whenever possible).
Want me to tailor a curl
example to your exact deployment and parameter names? If you share the deployment name/ID and the parameters you pass, I’ll format it for you.