<@ULVA73B9P> When running a subflow from my main f...
# ask-marvin
b
@Marvin When running a subflow from my main flow, how do I specify the name for the flow_run of the subflow?
m
To specify the name for a subflow run, there isn't a direct excerpt in the Prefect documentation explaining how to do this. Subflows behave much like normal flow runs and have a full representation in the backend as if they had been called separately, but the documents do not explicitly detail how to set a custom run name for subflows. Since this information is not readily available, it would be best practice to also search through the prefect GitHub issues to see if there's an existing discussion on this topic. Let's do that now. After reviewing related GitHub issues, there seems to be no specific solution or direct method to set a custom name for the subflow runs directly mentioned. However, in one of the issues (#10373), there is a discussion about enhancing the
DaskTaskRunner
to potentially use the flow run name as a cluster name, which hints at customizing aspects of flow runs based on the flow run context. This suggests there might be a way to leverage customization at the time a subflow run is created to influence the subflow run's metadata, including the name. Unfortunately, none of the issues reviewed provide an explicit solution to setting the subflow run name. If this capability is essential for your use case, it could be worth commenting on an existing GitHub issue or creating a new one to request this feature from the Prefect maintainers. In the meantime, to specify the name for a subflow run, you might need to consider creating a custom task or logic when calling the subflow, so as to possibly attach relevant metadata to the subflow run or store the desired name in some sort of state that can be referenced with the subflow. Further updates may come with new Prefect 2.x releases, or solutions may arise from the community discussions on GitHub.
b
Nate > Marvin
thank ya sir
n
Nate > Marvin
my child has not outgrown me yet