Can I call `subflows` in the `parent flow`?
# ask-community
u
Can I call
subflows
in the
parent flow
?
The code is running normally. But is this officially allowed to happen?
Copy code
from prefect import task, Flow

@task
def a():
    print('a!!')

with Flow("children-flow") as children_flow:
    a()

@task
def b():
    for i in range(2):
        children_flow.run()
    print('bb!')

with Flow("parent-flow") as parent_flow:
    b()

parent_flow.run()
k
I guess for local testing you can but if you want to run with a backend, you should use the StartFlowRun task here .