Adam Holderness
01/25/2025, 12:14 AMPOST - http://{LocalHost}/api/flow_runs
BODY
{
"flow_id": "2c1e5ce1-38ef-4a65-a762-ebb14630920d"
}
This correctly creates a flow run, but it remains in pending state and never actually runs.Nate
01/25/2025, 12:20 AMPOST /create_flow_run_from_deployment
Nate
01/25/2025, 12:21 AMScheduled
) state that your worker (client side poller) cares about / noticesNate
01/25/2025, 12:23 AMrun_deployment
to do this easily if you find yourself using the SDK, @Marvin short example of this plsMarvin
01/25/2025, 12:23 AMrun_deployment
in Prefect 3.x, you can follow this simple example. This assumes you are using the Prefect SDK to trigger a deployment programmatically.
Here's a basic example of how you might use `run_deployment`:
python
from prefect.deployments import run_deployment
# Run a deployment by specifying the deployment name and flow name
deployment_run = run_deployment(
deployment_name="my-deployment",
flow_name="my-flow"
)
# You can access the deployment run's ID or other metadata if needed
print(deployment_run.id)
This snippet will trigger a deployment that you've previously created in your Prefect Cloud or Prefect Server setup. You'll need to replace "my-deployment"
and "my-flow"
with your actual deployment and flow names.
For more details on using deployments in Prefect, you can refer to the Prefect Deploy documentation.Nate
01/25/2025, 12:24 AMdeployment_run = run_deployment(
"flow-name/my-deployment", parameters={...}
)
Adam Holderness
01/25/2025, 12:30 AMNate
01/25/2025, 12:31 AM