Hey all, what is the best practice for running mul...
# ask-community
j
Hey all, what is the best practice for running multiple subflows as separate deployments (so that they run on isolated infrastructure)? I've used
run_deployment
but that appears to be synchronous. I'd like to kick off multiple subflows in parellel but have the parent flow wait for the completion of all of them before continuing. Looking for an async.gather like behavior here
1
n
hi @Jonathan Samples - we're working on making this more clear (in terms of what your IDE shows you) but
run_deployment
is actually an async function that will run synchronously if you use it in a sync context ie you can just
asyncio.gather
run_deployment like this
j
Oh fantastic! Thanks @Nate. While you're at it where can I import the model classes from (since the typing isn't quite working yet). I tried:
Copy code
from prefect import FlowRun
So that I could at least cast it but no nice
n
from prefect.client.schemas.objects import FlowRun
🙏 1
you can always just go to definition on
run_deployment
and then go to definition on
FlowRun
if you have something like vs code
j
Good point. I'm kinda new to python so thanks for the help!
n
sure thing!