Skip to content

Core Concepts ​

A workflow is a YAML file that lists steps and the order they run in. Each time it starts, Dagu creates a run with its own ID, status, logs, and outputs, and keeps all of it in files. This page explains those pieces and the processes that execute them.

TermMeaning
DAGA workflow defined in one YAML file. Its name is the file name without .yaml, unless name: sets one.
StepOne unit of work: a shell command (run:) or a built-in action (action: with with: inputs).
Dependencydepends: on a step. The step starts after the steps it names succeed.
RunOne execution of a DAG, with a run ID, a status, a log per step, and outputs. Also called a DAG run.
AttemptOne try of a run. dagu retry adds an attempt under the same run ID.
ScheduleCron expressions in schedule: that start runs automatically.
QueueHolds runs that wait for a free slot before they start.

DAGs and Steps ​

DAG stands for directed acyclic graph: steps point to the steps they depend on, and the dependencies cannot form a loop. This DAG extracts data, then transforms and validates it in parallel, then loads it:

yaml
# etl-daily.yaml
schedule: "0 2 * * *"
steps:
  - id: extract
    run: printf 'rows=%s\n' 1200 >> "$DAGU_OUTPUT_FILE"
    outputs:
      - name: rows

  - id: transform
    run: echo "transforming ${steps.extract.outputs.rows} rows"
    depends: extract

  - id: validate
    run: echo "checking the schema"
    depends: extract

  - id: load
    run: echo "loading the warehouse"
    depends: [transform, validate]
  • Order comes from depends. Steps without depends start at once, in parallel. Set type: chain at the top of the file to run steps one after another in file order instead.
  • Steps pass data through outputs. extract writes rows=1200 to $DAGU_OUTPUT_FILE, and transform reads it as ${steps.extract.outputs.rows}. See Outputs.
  • A step runs a command or an action. run: executes a shell command. action: calls a built-in action, such as an HTTP request, a container, or an SSH command:
yaml
steps:
  - id: health_check
    action: http.request
    with:
      method: GET
      url: https://example.com/health

Built-in actions are listed under Actions. Lifecycle handlers (handler_on:) run extra steps when a run succeeds, fails, or exits. See Lifecycle Handlers.

Runs ​

A run starts in one of these ways, and each one records its trigger:

TriggerHow it starts a run
CLIdagu start etl-daily.yaml runs it in the foreground. dagu enqueue adds it to a queue.
Web UI and REST APIThe Start button, or POST /api/v1/dags/{name}/start
ScheduleA schedule: cron expression, while the scheduler runs
WebhookAn HTTP request to the DAG's webhook
Watched folderA file arriving in a watched folder
Sub-DAGA step in a parent DAG calls it. See Sub-DAGs.

A run moves through these statuses:

StatusMeaning
not_startedThe DAG has no run yet.
queuedThe run waits in a queue for a free slot.
runningSteps are executing.
waitingA step waits for a person to approve it or complete a human task.
succeededEvery step finished successfully.
partially_succeededA step failed, continue_on let the run go on, and the rest finished.
failedA step failed and stopped the run.
abortedSomeone stopped the run, for example with dagu stop or the Stop button.
rejectedA person rejected a waiting step.

succeeded, partially_succeeded, failed, aborted, and rejected are final. dagu retry reruns a finished run under the same run ID as a new attempt, and dagu restart starts a running DAG again with a new run ID. See the CLI Reference.

Step Lifecycle ​

Each step has its own status. A step starts when every step it depends on has finished successfully:

Step statusMeaning
not_startedThe step waits for its dependencies.
runningThe command or action is executing.
retryingThe step failed and waits for its next retry_policy attempt.
waitingThe step waits for a person's approval or input.
succeededThe step finished with exit code 0, or the action succeeded.
partially_succeededSome of the step's own work failed, such as some items of a loop or some runs of a sub-DAG.
failedThe command exited non-zero or the action failed.
abortedThe step was stopped, or did not run because a step it depends on failed.
skippedA precondition was not met, so the step did not run.
rejectedA person rejected the step.

In the Web UI, each step's color shows its status. In this run, render failed, so send never ran and shows as aborted; archive was skipped by its precondition; cleanup succeeded; and the onFailure handler ran:

Run graph in the Web UI with succeeded, failed, aborted, and skipped steps, and a failure handlerRun graph in the Web UI with succeeded, failed, aborted, and skipped steps, and a failure handler

Processes ​

One dagu binary provides every process. A run started from the CLI executes in the dagu start process itself, and the server and the scheduler start each run as its own dagu start process. In distributed mode they hand runs to the coordinator instead, which passes them to workers and records what the workers report. Every process keeps state in files under DAGU_HOME; there is no database or message broker.

ProcessCommandRole
Serverdagu serverServes the Web UI, the REST API, and the MCP endpoint on port 8080.
Schedulerdagu schedulerStarts runs when schedules fire, and starts queued runs as slots free up.
Coordinatordagu coordinatorgRPC service on port 50055 that hands runs to workers.
Workerdagu workerPolls the coordinator, executes runs on its machine, and reports status and logs back.

dagu start-all runs the server, the scheduler, and the coordinator in one process. Set DAGU_COORDINATOR_ENABLED=false to leave the coordinator out. A single machine needs nothing else. To spread runs across machines, see Deployment Models and Architecture.

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