Hey everyone, what is the best way of finding out ...
# ask-community
d
Hey everyone, what is the best way of finding out what labels a flow run was run with while executing inside the flow?
a
you can leverage the FlowRunView:
Copy code
from prefect.backend import FlowRunView

# Create a new instance using an ID from the UI or from the output of the `prefect run` command
flow_run = FlowRunView.from_flow_run_id(
    "4c0101af-c6bb-4b96-8661-63a5bbfb5596"
)

# You now have access to information about the flow run
flow_run.labels      # {"foo"}
d
awesome thank you