Hi all - I am wondering what the best way is to de...
# ask-community
l
Hi all - I am wondering what the best way is to determine what agent a flow is running on while its in progress
a
the easiest way would be to do find that out through labels, e.g. if you have the label “dev” assigned to a specific agent, and the same label is assigned to a flow’s run configuration
l
would that be say a subclassed Task’s context?
a
it’s an attribute of a run configuration. You can see it in the UI under flow. From code, you could inspect it this way:
Copy code
from prefect.run_configs import LocalRun
run_config=LocalRun(labels=["dev"])

# inspecting:
run_config.labels
{'dev'}
k
You can go to the
Agents
tab in the dashboard and it will give you the view
l
I had terrible wording in my question, I mean in the context of inside a task
k
It might have to be a graphql query. It won’t be in context
This is how the UI does it
l
Got it - thank you
k
Actually this might not help because you need to know the agent ids head of time to check
l
I think I can solve the issue I’m facing with configmap values for my agent - its basically agent specific configuration values
k
That sounds good