In Prefect 2.x, a subflow run is created when a flow function is called within the execution of another flow. The primary flow acts as the "parent" flow, and the flow created within it is the "child" or "subflow."
To identify the parent flow run for a given subflow run in the database, you would typically look for a reference to the parent flow run ID within the metadata of the subflow run. This relationship is maintained in the backend, allowing the subflow to be represented as if it had been called separately.
For more detailed information, you can refer to the
Prefect 2.x documentation on composing flows.