https://prefect.io logo
Title
d

David Cupp

10/10/2022, 4:20 PM
So in Prefect 2, task objects have a handle
submit()
method that lets you create task objects and them submit them directly, using
wait_for
to specify dependencies. Is there any similar mechanism for sub flows? I am interested in launching a "subflow" but without directly calling the annotated flow method, because I don't know which method I'm calling until runtime. For example, I would like to do this:
result = make_rpc_call()
newflow = Flow(
   name=result.name,
   parameters=result.parameters,
).submit(wait_for=[...])
is this possible?
1
k

Kalise Richmond

10/10/2022, 6:03 PM
Hi David, the
.submit
is not available yet for Flows and you can track the status on this issue. Until then you can use the
run_deployment
command to trigger the subflow.
d

David Cupp

10/10/2022, 9:14 PM
Awesome thanks!