Can prefect run flows in parallel? I know in tasks...
# ask-community
c
Can prefect run flows in parallel? I know in tasks you can run <task_function>.submit. Can this be done for flows/subflows?
n
hi @Charles Leung -
my_task.submit()
will execute tasks concurrently using the
ConcurrentTaskRunner
by default, if you want actual parallelism you'd have to use
DaskTaskRunner
or
RayTaskRunner
. as of now, there is not a
my_flow.submit()
method, but you can
asyncio.gather(*subflow_calls)
there is also experimental behavior to run many subflows in at the same time on a served process does one of the above suit your use case?
r
If the flows have deployments created, I think
run_deployment
will run them in parallel and then you can use
gather
to wait until they all finish.
upvote 1
c
We want to use flows because we have a large deployment that encompasses a lot of deployments
Oh nice - I think run_deployment is exactly what were looking for
😀 1