Robert Bastian

02/21/2023, 6:24 PM
Hello! I'm working with flows and "sub-flows" with Kubernetes as our infrastructure. Is it possible to have the child "sub-flows" run in the same pods dispatched (affinity) for the parent flow? It seems that since run_deployment talks to the Prefect server, this may not be possible. Thx! rb


02/21/2023, 6:53 PM
Hi @Robert Bastian If I'm understanding correctly that you want to run subflows on the same infrastructure as your parent flow, you can just call the subflow directly from the parent flow
def child():

def parent(): # assuming this is the flow deployed with -ib kubernetes-job
   child() # this will run on whatever infra was created for `parent`