Skip to content

Data Flow ​

Data enters a run as parameters and environment values, moves between steps as outputs and files, and leaves as artifacts or persistent state. This page shows each path with one short example. To pick a value source, see Data and Variables.

Small values travel as references such as ${params.date}, which Dagu resolves before a step starts. Large data travels as files, and only its path is passed along.

Parameters ​

Inputs chosen when the run starts:

yaml
params:
  - name: date
    default: "2026-12-01"

steps:
  - id: extract
    run: echo "extracting orders for ${params.date}"
bash
dagu start orders.yaml -- date=2026-12-02

See Parameters.

Environment Values ​

Settings every step shares, also passed to each process as environment variables:

yaml
env:
  - DATA_DIR: /var/data/orders

steps:
  - id: list
    run: ls "${env.DATA_DIR}"

See Environment Values.

Step Outputs ​

Small values one step computes for later steps:

yaml
steps:
  - id: count
    run: printf 'rows=%s\n' 120 >> "$DAGU_OUTPUT_FILE"
    outputs:
      - name: rows

  - id: report
    run: echo "loaded ${steps.count.outputs.rows} rows"

The reference also makes report wait for count. See Outputs.

Files ​

Without a working_dir, every step of a run starts in the same per-run work directory (DAG_RUN_WORK_DIR). A relative path written by one step is readable by the next, and two runs never share it.

yaml
steps:
  - id: download
    run: curl -fsS -o orders.json https://api.example.com/orders

  - id: count
    depends: download
    run: jq length orders.json

A file path creates no dependency, so count needs depends. To run a script stored next to the DAG, set working_dir or declare the script as a file dependency. To reuse a file-producing step when its inputs have not changed, use a build workflow.

Standard Input ​

stdin names a file whose contents Dagu pipes to the step's command. ${<id>.stdout} is the path of a step's captured stdout, so it feeds one step's output into the next:

yaml
steps:
  - id: fetch
    run: curl -fsS https://api.example.com/orders.csv

  - id: count_lines
    depends: fetch
    stdin: ${fetch.stdout}
    run: wc -l

A step without stdin receives empty standard input.

  • The path resolves before the command starts. A leading ~ expands to the home directory, and a relative path resolves against the step working directory.
  • $NAME in the path reads only the step environment, not the host process environment.
  • Each command of an array-form run reads the file from its start.
  • Only run steps accept stdin, and dagu validate reports it on any other step type, including ssh and steps that inherit a root-level container:. Harness steps take inline text through with.stdin.
  • The step fails, rather than running with empty input, when the file cannot be opened, or the path is empty or still contains an unresolved reference.

Artifacts ​

Files kept with the run for people to preview or download:

yaml
steps:
  - id: summary
    run: |
      echo "# Orders"
      echo "Loaded 120 rows"
    stdout:
      artifact: reports/summary.md

See Artifacts.

Persistent State ​

Small JSON values the next run reads, such as a cursor:

yaml
steps:
  - id: save_cursor
    action: state.set
    with:
      key: cursors/orders
      value:
        last_id: 1042

See Persistent State.

Runtime Metadata ​

Values about the run itself, such as its ID and log file:

yaml
steps:
  - id: archive_log
    run: cp "${context.paths.log_file}" "/backup/${context.run.id}.log"

See Runtime Variables.

Output Size ​

max_output_size limits both the stdout a step captures and the file it writes to $DAGU_OUTPUT_FILE; the default is 1 MiB. See Output Size Limit.

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