Hello. I see that calling a flow inside another fl...
# ask-community
m
Hello. I see that calling a flow inside another flow (calling a subflow) doesn't allow task methods (such as submit or map). I need to submit runs of a subflow mapped over a list of input. Is there a straightforward way to do this? I saw the docs mentioning AnyIO task groups and asyncio.gather, but it seemed a bit too complicated.
n
Hi @Mansour Zayer - do you want these subflows to run on the same infrastructure as the parent flow that's calling them?
m
I'm open to both options (subflow runs on their own pods, or on the same pod as the parent flow).
n
gotcha - here's a fully async example of running subflows on their own infra (if desired) via
run_deployment
we're working on improvements to async subflows (when just calling them like python functions or using submit/map), but right now the simplest way is to do something like
Copy code
subflow_results = [subflow(i) for i in some_list_of_inputs]
which will not be async
🙌 1