Oliver Tedder
02/10/2025, 10:18 AMMarvin
02/10/2025, 10:18 AMrun_deployment
function from the prefect.deployments
module. Here's a concise example of how you can do this:
python
from prefect.deployments import run_deployment
# Run a deployment with optional parameters
flow_run = run_deployment(
name="your-deployment-name", # Replace with your deployment's name or UUID
parameters={"param1": "value1"}, # Optional parameters for the flow
flow_run_name="custom-run-name", # Optional custom name for the flow run
tags=["example-tag"], # Optional tags
work_queue_name="your-work-queue" # Optional work queue
)
print(flow_run)
Make sure to replace placeholders like "your-deployment-name"
and "your-work-queue"
with your actual deployment name and work queue. For more details on the parameters, you can refer to the Prefect documentation.
If you need further customization, you can explore additional parameters like scheduled_time
, timeout
, and idempotency_key
.