<@ULVA73B9P> Can I have a dependencies between sub...
# ask-marvin
n
@Marvin Can I have a dependencies between sub flows so 1 sub flow can run for any successful previous sub flows?
m
In Prefect, a subflow run is created when a flow function is called inside the execution of another flow. The primary flow is the "parent" flow and the flow created within the parent is the "child" flow or "subflow." Subflows behave like normal flow runs and will block execution of the parent flow until completion. However, asynchronous subflows can be run in parallel by using AnyIO task groups or asyncio.gather. If you want to create dependencies between subflows, you can do so by structuring your parent flow such that the execution of one subflow is dependent on the successful completion of a previous subflow. This can be done by calling the subflow function in the parent flow in the desired order and handling any exceptions appropriately. For more details, you can refer to the Prefect documentation.