Hi - What is the best practice for running a `flow...
# prefect-community
i
Hi - What is the best practice for running a
flow
from a
flow
? Is it advisable? if so should I call
main()
or the
flow
directly?
main()
being a function in the module with the other
flow
.
z
Hi Itay! It's definitely possible to run a flow from another flow-- the most common way we see this done is to kick off the flow from a final task in the first flow. As for whether it's advisable and the best way to do so, would you mind sharing a bit about your use case?
i
I have a
flow
called
make knowledge graph
that manages another
flow
called
make node
.
make node
can be run in parallel/mapped as long as the first
make node
is built. basically like a web scraper
z
Okay, gotcha-- thanks for the use case! On a surface level, your use case sounds like it might be better managed as tasks and mapped tasks within a flow, rather than two interdependent flows. That said, there's absolutely nothing stopping you from running these as two flows! There's no prescribed manner of calling a flow from another flow-- either of the ways you mentioned should do the trick. @josh any final thoughts?
j
Nope! No set way of performing this action. Just wondering, is there a reason preventing you from having the
make node
Flow a downstream branch of your
make knowledge graph
Flow?