HI, I am not able to run any flow atm though Prefe...
# ask-community
m
HI, I am not able to run any flow atm though Prefect dashboard shows I am using 0 slot
One Prefect agent is running
g
Does the flow have the same label(s) as the agent? https://docs.prefect.io/orchestration/agents/overview.html#labels
m
Ah I see. The flow has different label than the agent.
Isn't it automatic whichever agent is available and flow would run on it.
g
No, it's not automatic. Many Prefect setups make use of multiple agents which should only run certain flows, and labels are a good way of ensuring each flow is only run by the correct agent.
upvote 1
m
Ah makes sense. So how do assign an agent to a flow?
g
You assign a label to the flow, and you launch the agent with the same label. (Or if your setup is really simple, have no labels on the flow or the agent; agents with no labels will execute flows which have no labels). When the flow run is triggered, an agent which has the matching labels will see the pending flow run and will start executing it.
m
Thank you so much. It seems like flow and agent are using some default labels.