Hello everyone, is it possible to add/remove label...
# prefect-community
Hello everyone, is it possible to add/remove labels from agents through the API with
? Thanks!
If you want to change labels for a specific run, you can specify that on your run_config in the
mutation. But if you want to change those run_config labels permanently, you would need to reregister the flow since run config is part of the metadata that gets stored in the API backend
Sorry if I wasn’t clear. I’m referring to changing what labels an agent has, not changing anything about the flows.
What I’m really trying to do is prevent an agent from running specific flows. Maybe there is an easier way, for example is it possible to set the concurrency limit to 0 for a specific flow?
I believe that API mutation is not related to Agent labels, but Agent Automations so I think the answer here is no. A concurrency limit of 0 for a Flow would mean that the Flow is forever queued and never runs. Is that what you want? I think in this case you might have to restart the agent with additional/less labels.
As long as you set the labels properly on each flow's run configuration, you can ensure which agent will pick it up - that's the most straightforward approach. And changing labels requires registration to send new flow metadata to the backend. Also always setting unique labels when starting any agent can prevent that. Can you explain the problem a bit more? How many agents do you have?