what is recommended way to launch a separate flow run within a flow for Prefect2 ? In Prefect 0.x, it had create_flow_run(flow_name), but don’t see that in Prefect2.x. Is there way to launch a flow run based on its name?
n
Nate
03/28/2024, 3:59 PM
hi @Joe Uhm - that's
run_deployment
now
Copy code
from prefect.deployments import run_deployment
# if we have some-flow/some-deployment already created
flow_run = run_deployment("some-flow/some-deployment", parameters={"foo": 42})
# pass timeout=0 to avoid waiting for the flow run to complete as the caller
👍 1
j
Joe Uhm
03/28/2024, 4:02 PM
@Nate if you don’t have the deployment name, does it accept like this, run_deployment(“some-flow/*“, parameters={foo”:42}) ? i just want to run the latest or single deployed flow
Joe Uhm
03/28/2024, 4:03 PM
by flow name only
Joe Uhm
03/28/2024, 4:07 PM
or, look up all the existing deployments of a flow, to pick one
Joe Uhm
03/28/2024, 4:13 PM
@Nate is there way to look up list of all deployment names of a flow?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.