Is there anyway to see which agent is currently ru...
# ask-community
l
Is there anyway to see which agent is currently running a task (specifically a label)? Use case I am looking to handle is to select Secrets based on agent label/environment (dev vs. prod)
k
Hi @Leon Kozlowski, there is no good way to do this at the moment. The best way would be a parameter that controls the the appropriate Secrets once resolved. Secrets would then need to be named differently like
prod_dbconnection
,
dev_dbconnection
. If these really need to be the same name, then you would need multiple tenants to hold those secrets.
l
Environment based naming should work fine for me
z
You can also query for the current labels during your flow run since the current flow run id is in the context
l
This worked for me
Copy code
query {
  flow_run_by_pk(id: "<FLOW_RUN_ID>") {
    agent {
      labels
    }
  }
}