Hello. In Prefect 1: Context: we have a flow of fl...
# prefect-community
m
Hello. In Prefect 1: Context: we have a flow of flows, and to manage dependencies, we have 2 solution. Either make sure the infra registers the flows in order, or to import and register the underlying flows in the flow-of-flows. What could go wrong if you do register a flow in the flow-of-flows like
Copy code
from underlying_flows.flow_a import flow_a

flow_a.register(project...)

With Flow(...):
    ...
Because when we do that, prefect throws a warning
UserWarning: Attempting to call "flow.register" during execution of flow file will lead to unexpected results.
👀 1
b
Hello Mansour, thank you for reaching out. I'm not 100% sure what could go wrong with registering a flow in a flow of flows like that (although I am sure one of my colleagues knows), but I can point you in the direction of this helpful article which shows how to schedule a flow-of-flows and managing their dependencies.
m
Thanks for the reference. However, my concern is registering the flows. This article starts after the flows are registered. When you have your infra-as-code in Terraform, managing the process of how to register flows becomes an important part to ensure everything works in all environments and regions.
b
Hello Mansour, thank you for clarifying. If you haven't done a significant amount work in 1.0, I would recommend using 2.0 for this very reason. It's much easier to construct a flow of flows, without having to register the individual child flows separate from the parent flow (the process of registration isn't even necessary in 2.0).
👍 1