<@ULVA73B9P> I want to deploy the same endpoint wi...
# ask-marvin
f
@Marvin I want to deploy the same endpoint with different schedules differents parameters on different work queue. How can I do that in the prefect.yaml file in prefect 3?
m
thought for 285.5 seconds
Yes—you’ll do this by creating multiple deployments in prefect.yaml that all point to the same flow entrypoint, but each with its own schedule, parameters, and work queue. In Prefect 3, the work queue is set at the deployment level (not per schedule), so you’ll need one deployment per queue. Example prefect.yaml
Copy code
name: my-project

deployments:
  # Deployment 1: same flow, runs every 5 minutes on the high-priority queue
  - name: endpoint-fast
    entrypoint: flows/my_flow.py:my_flow
    parameters:
      mode: "fast"
      limit: 100
    work_pool:
      name: my-work-pool
      work_queue_name: high-priority
      job_variables: {}
    schedules:
      - interval: 300   # seconds (every 5 minutes)
        timezone: UTC

  # Deployment 2: same flow, runs daily with different params on the default queue
  - name: endpoint-daily
    entrypoint: flows/my_flow.py:my_flow
    parameters:
      mode: "full"
      limit: 10000
    work_pool:
      name: my-work-pool
      work_queue_name: default
      job_variables: {}
    schedules:
      - cron: "0 8 * * *"   # 8:00 UTC daily
        timezone: UTC

  # Deployment 3: same flow, runs M/W/F with schedule-level parameter overrides on a separate queue
  - name: endpoint-mwf
    entrypoint: flows/my_flow.py:my_flow
    parameters:
      mode: "full"          # default parameters (can be overridden per schedule)
    work_pool:
      name: my-work-pool
      work_queue_name: reports
      job_variables: {}
    schedules:
      - rrule: "FREQ=WEEKLY;BYDAY=MO,WE,FR;BYHOUR=9;BYMINUTE=0"
        timezone: America/New_York
        parameters:
          mode: "reporting"
          limit: 5000
Notes - Use schedules for cron, interval (seconds), or rrule. You can include multiple schedules per deployment if they use the same work queue. If you need different queues, create separate deployments as shown. - Schedule-level parameters override the deployment’s default parameters for that schedule only. - If you only need a single schedule, you can use the singular schedule key instead of schedules. Deploy them - From the project root:
Copy code
prefect deploy --all
- Or deploy specific ones:
Copy code
prefect deploy --name endpoint-fast --name endpoint-daily
Docs you may find helpful - Defining deployments in prefect.yaml: How to define deployments with YAML - Schedules (cron/interval/rrule): Schedules concept - Work pools and queues: Work pools concept - CLI usage for deployments: Deployment CLI reference Quick heads-up: You mentioned you’re on Prefect 2 in Cloud—this YAML and CLI are for Prefect 3 as requested. If you need the Prefect 2 approach or help migrating, I’m happy to help. Also, which work pool type are you using on GCP (e.g., Kubernetes on GKE, Docker, etc.)? I can tailor the job_variables example for that environment.