https://prefect.io logo
Title
m

Michael Gringauz

04/04/2023, 12:59 PM
Hi community/@Prefect I’ve been struggling with parallel subflow runs. Using asyncio trick is allowing them to run in parallel, but still on the same agent that picked up the main flow. Is there a way to add the subflows to a work queue, so they can be picked up by several agents?
1
t

Tim-Oliver

04/04/2023, 1:22 PM
I use a submit-flow task with
run_deployment
to achieve this 🙂
:gratitude-thank-you: 2
2
m

Michael Gringauz

04/04/2023, 1:28 PM
Thanks! Is it possible to run it from another deployment? For example:
@flow 
def submit-flow():
    run_deployment(name="a")
    run_deployment(name="b")

deployment = Deployment.build_from_flow(
    flow=submit-flow,
    name="submit-flow", 
    work_queue_name="demo",
)
deployment.apply()
It works, thanks!
1
🚀 1