<@ULVA73B9P> Can a deployment be served by multipl...
# ask-marvin
j
@Marvin Can a deployment be served by multiple work pools?
m
thought for 205.6 seconds
Short answer: No. In Prefect 3.x, a deployment targets exactly one work pool (and optionally a queue within that pool). If you want the same flow to run in multiple pools, create multiple deployments (one per pool) that reference the same flow. Example via Python:
Copy code
from prefect import flow

@flow
def my_flow():
    pass

# One deployment per pool
my_flow.deploy(name="my-flow-prod", work_pool_name="prod-pool")
my_flow.deploy(name="my-flow-staging", work_pool_name="staging-pool")
Example via prefect.yaml:
Copy code
deployments:
  - name: my-flow-prod
    entrypoint: flows/my_flow.py:my_flow
    work_pool:
      name: prod-pool

  - name: my-flow-staging
    entrypoint: flows/my_flow.py:my_flow
    work_pool:
      name: staging-pool
Then apply them:
Copy code
prefect deploy --all
References: - Deployments concepts (deployment schema and requirements) - Work pools concepts - Define deployments with prefect.yaml (multiple deployments in one file) If you share the pool names you’re targeting, I can tailor the YAML/Python examples to your setup.