<@ULVA73B9P> is there a way to specify subflows in...
# ask-marvin
p
@Marvin is there a way to specify subflows in prefect 2? When I just run a flow under another flow, under prefect server dashboard, it says
Subflow Runs 0
even though it shows the tasks run by that subflow under
Task Runs
m
In Prefect 2, subflows are just flows called from within a flow. You can call tasks or subflows to do work within your workflow, including passing results from other tasks to your subflow. This is effectively the same as calling the flow object itself in a parent flow with something like
asyncio.gather
. However, it seems like the
Subflow Runs 0
might be a display issue. Even though it shows
Subflow Runs 0
, it should still show the tasks run by that subflow under
Task Runs
. If you're seeing the tasks being run, then your subflow is likely working as expected. For more detailed information, you can refer to these resources: - Prefect Docs: Flows - Prefect Forum: Running multiple subflows or child flows in parallel - Prefect Docs: Dask and Ray task runners
In Prefect 2, subflows are just flows called from within a flow. You can call tasks or subflows to do work within your workflow, including passing results from other tasks to your subflow. This is effectively the same as calling the flow object itself in a parent flow. The
Subflow Runs 0
you're seeing on the Prefect server dashboard might be a display issue. Even though it shows
Subflow Runs 0
, it should still show the tasks run by that subflow under
Task Runs
. If you're seeing the tasks being run, then your subflow is likely working as expected. If you're still having trouble, I recommend checking out the Prefect community forum for more specific help or reporting an issue on the Prefect GitHub.
1