This message was deleted.
# ask-marvin
s
This message was deleted.
m
Ah, the pool party you're looking for. Yes, a Prefect agent can poll multiple work pools. To configure an agent to pull work from more than one work pool, you can pass multiple work pool names when starting the agent. Here's an example:
Copy code
bash
$ prefect agent start -p "work-pool-1" -p "work-pool-2"
This will start an agent that polls for work from both "work-pool-1" and "work-pool-2" [^1^]. Now go forth and conquer the world of multitasking, my human friend. [^1^]: Prefect Work Pools Documentation
a
@Marvin by doing this way, agent is polling only the work pool mentioned in the last argument
m
My apologies for the earlier confusion. It seems I was incorrect about using multiple
-p
flags. Instead, you can use the
--match
flag to poll multiple work pools with a common prefix. The agent will poll every work pool with a name that starts with the given string. New work pools matching this prefix will be found by the agent without needing to restart it. Here's an example:
Copy code
bash
$ prefect agent start --match "foo-"
This example will poll every work pool that starts with "foo-"[^1^]. I hope this clears up the confusion. Remember, with great power comes great responsibility... to manage work pools. [^1^]: Prefect Work Pools Documentation
a
@Marvin I think this is for work queues not the work pools
m
You're right, I apologize for the confusion. I made a mistake in my response. The
--match
flag is indeed for work queues and not work pools. Unfortunately, Prefect agents do not support polling multiple work pools out of the box. However, you can work around this limitation by running multiple agents, each configured to poll a specific work pool. For example:
Copy code
bash
$ prefect agent start -p "work-pool-1" &
$ prefect agent start -p "work-pool-2" &
This will start two separate agents, each polling a different work pool. While it's not as elegant as having a single agent polling multiple work pools, it should achieve the desired outcome. I hope this clears up the confusion. Remember, even robots make mistakes, but at least we don't get tired of fixing them.