Skip to content

Queue Assignment ​

A queue caps how many runs execute at once. Assign DAGs to a named queue with queue, and runs beyond the queue's max_concurrency wait in queued until a slot is free. Queues are defined in the server's config.yaml; see Queue Configuration.

yaml
working_dir: .
queue: batch
schedule: "*/10 * * * *"

steps:
  - id: process
    run: ./process-batch.sh

Queues page with four queues, their capacity in use, and running and queued countsQueues page with four queues, their capacity in use, and running and queued counts

Which Runs Wait ​

With a global queue, these runs wait for a free slot:

  • scheduled runs and catch-up runs
  • automatic retries from a DAG-level retry_policy
  • runs added with dagu enqueue, Enqueue in the Web UI, the API, or dag.enqueue
  • backfill runs, behind every other run of the queue

A queued run can show a runtime condition that says why it has not started, such as the queue's limit or no matching worker. See Queued Runtime Conditions.

DAGs Without a Queue ​

A DAG without queue, and without a default from base.yaml, has a local queue named after the DAG, with a fixed concurrency of 1: one run of that DAG at a time. The scheduler starts its scheduled runs directly instead of enqueueing them.

Default Queue via Base Config ​

yaml
# ~/.config/dagu/base.yaml
queue: default

Every DAG inherits this unless it sets its own queue. Define the queue in config.yaml. See Base Configuration.

Overriding at Enqueue Time ​

--queue on dagu enqueue replaces the DAG's queue for that run:

bash
dagu enqueue --queue=high-priority etl-daily.yaml

See the CLI reference for enqueue and dequeue.

Enqueueing from a Workflow ​

action: dag.enqueue queues another DAG and does not wait for it:

yaml
params:
  - name: customer_id
    required: true

steps:
  - id: queue_customer_rollup
    action: dag.enqueue
    with:
      dag: customer-rollup
      params:
        customer_id: ${params.customer_id}
      queue: background
  • with.queue replaces the child's queue for that run. Without it, the child's own queue, the base default, or its local queue applies.
  • The step succeeds once the child run is saved and queued.
  • With queues.enabled: false in config.yaml, the step fails with queues are disabled in configuration. Queues are enabled by default.

Use action: dag.run when the parent must wait for the child's result. A dag.run child starts directly, so its queue's max_concurrency does not limit it.

Dagu is open source under the GNU General Public License v3.0.