YAML Specification
This page lists every field a workflow file accepts, with its type, default, and a link to the page that explains it. Feature pages own the behavior; this page is the index of names. Unknown fields are rejected.
The same schema ships with the binary:
dagu schema dag # top-level fields
dagu schema dag steps # step fields
dagu schema dag steps.container # one nested blockMinimal Workflow
steps:
- run: echo "hello"A file defines one DAG. Without name, the DAG takes the file name without its extension. Separate documents with --- to define sub-DAGs in the same file.
Typical Workflow
description: Publish the weekday sales report
labels:
- team=analytics
schedule: "0 8 * * MON-FRI"
timeout_sec: 3600
params:
- name: region
type: string
default: us-east-1
enum: [us-east-1, us-west-2]
env:
- REPORT_DIR: reports
defaults:
retry_policy:
limit: 2
interval_sec: 30
steps:
- id: export_sales
run: ./bin/export-sales --region "${params.region}" --out "${env.REPORT_DIR}/sales.json"
- id: summarize
depends: export_sales
run: |
revenue=$(jq '[.[].total] | add' "${env.REPORT_DIR}/sales.json")
printf 'revenue=%s\n' "$revenue" >> "$DAGU_OUTPUT_FILE"
outputs:
- name: revenue
- id: render
run: ./bin/render-report --revenue "${steps.summarize.outputs.revenue}"
stdout:
artifact: daily.md
handler_on:
failure:
action: mail.send
with:
to: ops@example.com
subject: "${context.dag.name} failed"
message: "See ${context.paths.log_file}"render reads an output of summarize, so it runs after it without depends.
Field Index
Top-Level Fields
| Field | Purpose |
|---|---|
actions | Reusable custom actions |
artifacts | Per-run artifact storage |
calendar | Business calendar for start schedules |
catchup_window | Replay missed runs after downtime |
consts | Values fixed at load time |
container | Shared container for the run |
dates | Dates derived from the schedule slot |
defaults | Default step settings |
delay_sec | Wait before the first step |
description | What the DAG does |
dotenv | .env files to load |
env | Environment for every step |
error_mail | Failure email settings |
group | Group name in the UI |
handler_on | Steps for run events |
harness | Defaults for harness.run |
harnesses | Custom coding-agent CLIs |
hist_retention_days | Days of history to keep |
hist_retention_runs | Number of runs to keep |
info_mail | Success email settings |
kubernetes | Defaults for kubernetes.run |
labels | Labels for filtering and workspaces |
llm | Defaults for model steps |
log_dir | Log directory |
log_output | Separate or merged stdout and stderr logs |
mail_accounts | Mailboxes for mail actions |
mail_on | When to send email |
max_active_steps | Steps running at once |
max_clean_up_time_sec | Cleanup time before a forced stop |
max_output_size | Captured output limit per step |
name | DAG name |
node | Require a bound node |
otel | OpenTelemetry tracing |
outputs | Named results of the DAG |
overlap_policy | Catch-up runs while one is running |
params | Run inputs |
preconditions | Checks before any step runs |
queue | Queue the run joins |
redis | Defaults for redis.* actions |
registry_auths | Private container registry credentials |
resources | CPU and memory limits |
restart_policy | Keep the DAG running like a service |
restart_wait_sec | Wait between service runs |
retry_policy | Retry the whole run |
run_config | Lock fields in the start dialog |
s3 | Defaults for s3.* actions |
schedule | When the DAG runs |
secrets | Secrets exposed as environment variables |
shell | Default shell for run |
shell_args | Extra shell arguments |
skip_if_successful | Skip a slot that already succeeded |
slot_retention_days | Days to keep schedule slot records |
smtp | Mail server |
ssh | Default SSH connection |
steps | The work |
tasks | Goals of an agent DAG |
timeout_sec | Time limit for the run |
tools | Pinned CLI tools |
type | How steps are scheduled |
wait_mail | Waiting email settings |
watch | Start a run per arriving file |
webhook | Webhook header forwarding |
worker_selector | Worker labels for the run |
working_dir | Working directory |
Deprecated: max_active_runs, step_types, tags. See Deprecated Fields.
Step Fields
| Field | Purpose |
|---|---|
action | Built-in, custom, or remote action |
approval | Wait for approval after the step runs |
container | Run the step in a container |
continue_on | Keep going after failure or skip |
dependencies | Files copied into the run |
depends | Steps that must finish first |
description | What the step does |
env | Environment for this step |
foreach | Run body steps per item |
id | Identifier for references |
inputs | Build inputs |
log_output | Separate or merged logs |
mail_on_error | Email when the step fails |
name | Step name |
nodes | Run once per inventory node |
output | Capture stdout into a variable |
output_schema | Validate stdout JSON |
outputs | Declared outputs |
parallel | Fan out child runs |
pass_env | Environment passed to a child run |
preconditions | Checks before the step |
repeat_policy | Run the step repeatedly |
retry_policy | Retry a failed step |
run | Shell command or script |
secrets | Secrets this step receives |
signal_on_stop | Signal sent when stopped |
stderr | Write stderr to a file or artifact |
stdin | File piped to standard input |
stdout | Write stdout to a file, artifact, or outputs |
timeout_sec | Time limit for the step |
untrusted | Isolate agent-controlled code |
with | Action inputs, or shell options for run |
worker_selector | Worker labels for a child run |
working_dir | Step working directory |
Deprecated: call, command, config, exec, llm, messages, params, routes, script, shell, shell_args, shell_packages, type, value. See Legacy Execution Fields.
Top-Level Fields
Metadata
| Field | Type | Default | Description |
|---|---|---|---|
name | string | File name | Up to 40 characters matching ^[a-zA-Z0-9_.-]+$. |
description | string | Shown in the UI and to agents. | |
group | string | Groups related DAGs in the UI. | |
labels | string, list, or map | team=data, [nightly, team=data], or {team: data}. workspace=<name> puts the DAG in a workspace. |
Execution Mode
| Field | Type | Default | Description |
|---|---|---|---|
type | string | graph | graph orders steps by depends. chain runs them in file order and forbids depends and router steps. agent lets a model pick steps; see Agent DAGs. build adds file-derived dependencies and reuse; see Build Workflows. |
tasks | list | Goals of a type: agent DAG, each with name and description. Required with type: agent and invalid otherwise. |
type: chain
steps:
- run: echo "first"
- run: echo "second"Scheduling
| Field | Type | Default | Description |
|---|---|---|---|
schedule | string, list, or map | Cron expressions, aliases such as @daily, one-off at times, or a start/stop/restart map. See Scheduling. | |
calendar | string | Business calendar for start entries that name none: weekdays, a calendar file, or none. | |
dates | map | Dates derived from the schedule slot, read as ${dates.NAME}. See Schedule Dates. | |
skip_if_successful | boolean | false | Skip a scheduled run when the DAG already succeeded since the previous scheduled time. Manual runs always run. |
catchup_window | duration | How far back to replay missed runs after scheduler downtime, such as 6h or 2d12h. Omit to replay none. | |
overlap_policy | string | skip | A catch-up run while the DAG is running: skip, all, or latest. |
restart_policy | string | no | always or unless-stopped keeps a run alive like a service. Not with schedule or a DAG retry_policy. See Services. |
restart_wait_sec | integer | 0 | With restart_policy, seconds between one run's end and the next start, at least 1. |
watch | map | Start a run for each file that arrives: path (required), pattern, and interval (default 10s). See Watched Folders. |
schedule:
start:
- "0 8 * * MON-FRI"
- expression: "0 3 * * *"
params: { mode: full }
stop:
- "0 18 * * MON-FRI"- Start entries accept
expression,at,params,profile,calendar, andbusiness_days. Stop and restart entries take cron only. atis an RFC 3339 time with an offset orZ, and seconds of:00.profilemakes an entry fire only when it names the DAG's default runtime profile.
Execution Control
| Field | Type | Default | Description |
|---|---|---|---|
queue | string | DAG name | Queue from the server configuration. See Queues. |
max_active_steps | integer | 0 | Steps running at once in one run. 0 or less is unlimited; -1 clears a base-config value. |
timeout_sec | integer | 0 | Time limit for the whole run. 0 is none. |
delay_sec | integer | 0 | Seconds to wait before the first step. |
max_clean_up_time_sec | integer | 5 | Seconds to stop steps and finish logs before processes are killed. |
preconditions | string or list | Checks before any step. See Conditions and Continuation. | |
retry_policy | map | Retries the whole run. See DAG Retry Policy. | |
run_config | map | disable_param_edit and disable_run_id_edit, both false by default, lock those inputs in the start dialog. See Parameters. | |
worker_selector | map or local | Labels a worker must have, such as {gpu: "true"}, or local to run on the server. Values can use ${params.*} and ${env.*}. | |
node | string | required makes the DAG run only bound to one node. See Node Targeting. | |
resources | map | limits.cpu and limits.memory for the whole run. See DAG Run Resource Limits. |
run_config:
disable_param_edit: true
disable_run_id_edit: trueTop-level resources limits the run on its host. Kubernetes pod resources go under kubernetes.resources.
DAG Retry Policy
Root retry_policy makes the scheduler start the whole run again after a failure. Step-level retry_policy is separate.
| Field | Type | Default | Description |
|---|---|---|---|
limit | integer or string | Required | Retries after the first failure. 0 turns them off. |
interval_sec | integer or string | 60 | Base delay before a retry. |
backoff | boolean or number | Multiplier per retry. true is 2.0. | |
max_interval_sec | integer or string | 3600 | Upper bound for the delay. |
History and Output Limits
| Field | Type | Default | Description |
|---|---|---|---|
hist_retention_days | integer | 30 | Days of run history to keep. A DAG with restart_policy keeps its latest 100 runs instead. |
hist_retention_runs | integer | Number of runs to keep. Not with hist_retention_days. | |
slot_retention_days | integer | 730 | Days to keep each schedule slot's record, which backfill reads. |
max_output_size | integer | 1048576 | Bytes of stdout one step can capture. A step that captures more fails. |
log_dir | string | paths.log_dir | Directory for this DAG's logs. |
log_output | string | separate | separate writes .out and .err files; merged writes one .log. |
Data, Environment, and Files
| Field | Type | Default | Description |
|---|---|---|---|
consts | list | Values fixed at load time, read as ${consts.name}. See Constants. | |
params | string, list, or map | Run inputs. See Parameters. | |
env | list or map | Environment for every step, evaluated in order. See Environment Variables. | |
dotenv | string or list | .env | Extra .env files, loaded after .env. [] turns loading off. See Dotenv Files. |
secrets | list | Secrets exposed as masked environment variables. Each entry has name and either ref, or provider with key and options. See Secrets. | |
outputs | map | Named results of the DAG. See DAG Outputs. | |
working_dir | string | Per-run work directory | Working directory of every step. A relative path resolves from the DAG file's directory. See Per-Run Work Directory. |
shell | string or list | System default | Default shell for run, such as bash -e or ["bash", "-e"]. |
shell_args | list | Arguments added to the DAG shell. | |
tools | list or map | Pinned CLI tools installed before the run. See Tools. | |
artifacts | map | On when used | Per-run artifact storage turns on when a step writes or reads artifacts. enabled forces it on or off; dir overrides the base directory. See Artifacts. |
DAG Outputs
Root outputs names the results of a DAG. Each value is exactly one declared output of a top-level step. Results are read from a run that succeeded or partially succeeded, for example by an A2A caller.
outputs:
summary: ${steps.diagnose.outputs.summary}
steps:
- id: diagnose
run: printf 'summary=%s\n' "disk at 91%" >> "$DAGU_OUTPUT_FILE"
outputs:
- name: summaryRoot outputs is not resolved at run time and does not change when steps run. A result is left out when its step published nothing or the value was masked as a secret.
Parameters
params:
- name: region
type: string
default: us-east-1
enum: [us-east-1, us-west-2]
- name: count
type: integer
default: 3
minimum: 1| Field | Type | Description |
|---|---|---|
name | string | Required. |
type | string | string, integer, number, or boolean. |
default | scalar | Literal default. |
eval | string | Computes the default when the run starts. See Computed Defaults. |
title, description | string | Label and help text in the start dialog. |
required | boolean | Requires a value when there is no default. |
enum | list | Allowed values. |
minimum, maximum | number | Numeric bounds. |
min_length, max_length | integer | String length bounds. |
pattern | string | RE2 regular expression for strings. |
params also accepts a positional string, KEY=value entries, an inline JSON Schema (type: object with properties), or an external schema with values. See Parameters.
Defaults
defaults applies to every step, handler, and foreach body step.
| Field | Merge with the step's own value |
|---|---|
retry_policy, repeat_policy, continue_on, timeout_sec, mail_on_error, signal_on_stop | The step's value replaces the default. |
env, preconditions | Default entries come first, then the step's. |
max_concurrent | Used by parallel and foreach steps without one, from 1 to 1000. |
See Step Defaults.
Custom Actions
| Field | Type | Description |
|---|---|---|
actions | map | Actions defined in this file. Each has type, input_schema, template, and optionally output_schema and description. They expand to ordinary steps when the DAG loads. |
A step's action can name a built-in, a custom action from this file or the base config, or a remote package such as owner/repo@v1. See Custom Actions.
Integrations and Defaults
| Field | Type | Description |
|---|---|---|
container | string or map | Shared container for the run. See Container. |
registry_auths | string or map | Credentials for private registries, as a DOCKER_AUTH_CONFIG JSON string or a map by registry host. See Private Registries. |
ssh | map | Runs every run step on a remote host, and is the default connection of ssh.run and sftp.*. See SSH. |
s3 | map | Defaults for s3.* actions. See S3. |
llm | map | Defaults for chat.completion, or the model of an agent DAG. See LLM. |
redis | map | Defaults for redis.* actions. See Redis. |
kubernetes | map | Defaults for kubernetes.run. See Kubernetes. |
harness | map | Defaults for harness.run: provider, model, fallback, and other provider options. See Harness. |
harnesses | map | Custom coding-agent CLIs that harness.run names in with.provider. |
mail_accounts | map | Mailboxes keyed by address, used by mail.search, mail.organize, and mail.send. See Mail Accounts. |
otel | map | Tracing: enabled, endpoint, headers, insecure, timeout, and resource. See OpenTelemetry. |
webhook | map | forward_headers lists request headers passed to webhook runs as WEBHOOK_HEADERS. See Webhooks. |
Container
A DAG-level container runs every command step in one shared container. A string names a running container to exec into; a map sets either exec or image.
container:
image: python:3.13-slim
volumes:
- ./data:/data
env:
- PYTHONUNBUFFERED: "1"| Field | Default | Description |
|---|---|---|
image | Image to run. Not with exec. | |
exec | Running container to exec into. With it, only user, working_dir, env, env_file, and shell apply. | |
pull_policy | missing | always, missing, never, fallback, or a boolean. |
env, env_file | Container environment, and dotenv files loaded into it. | |
volumes | host:container[:ro]. Relative host paths resolve from working_dir. | |
working_dir, user, shell | Directory, user, and shell inside the container. shell is a list. | |
ports, network, platform, name | Docker settings for the container. | |
startup | keepalive | keepalive, entrypoint, or command with command. |
wait_for | running | running or healthy. healthcheck sets a check for images without one. |
log_pattern | Regular expression to wait for in the logs. | |
restart_policy, keep_container | Docker restart policy, and keep the container after the run. |
Not with a DAG-level ssh. See Container for behavior and step-level containers.
SSH
ssh:
user: deploy
host: app.example.com
key: ~/.ssh/id_ed25519
steps:
- id: status
run: systemctl status myappstatus runs on app.example.com. Fields: host, user, port (default 22), key, password, passphrase, known_host_file, strict_host_key (default true), timeout (default 30s), shell, and bastion. key, password, and passphrase also accept {secret: <ref>}. An ssh.run step that sets connection fields in with replaces this block. See SSH.
S3
Defaults for s3.upload, s3.download, s3.list, and s3.delete: region, bucket, endpoint, profile, access_key_id, secret_access_key, session_token, force_path_style, and disable_ssl. See S3.
LLM
llm:
provider: anthropic
model: claude-sonnet-4-5Fields: provider, model, system, temperature, top_p, max_tokens, base_url, api_key_name, provider_order, stream, thinking, web_search, dags, skills, max_tools, max_tool_iterations, and tool_result_max_bytes. provider is openai, anthropic, gemini, openrouter, local, zai, or opencode. model can be a list of {provider, name} entries tried in order. An agent DAG also accepts max_context_tokens, observation_max_bytes, and observation_keep_recent. See LLM and Agent DAGs.
Redis
Defaults for redis.* actions: url, or host (default localhost), port (default 6379), username, password, and db (default 0); mode with sentinel_master, sentinel_addrs, or cluster_addrs; tls, tls_skip_verify, and max_retries (default 3). See Redis.
Kubernetes
Defaults for kubernetes.run and k8s.run steps, such as namespace, context, service_account, image, and resources. Step with values override them: scalars replace, maps merge by key, and lists replace. See Kubernetes.
Notifications
| Field | Type | Description |
|---|---|---|
mail_on | map | success, failure, and wait, each true to send email. |
error_mail, info_mail, wait_mail | map | from, to, prefix, and attach_logs for failure, success, and waiting email. |
smtp | map | host, port, username, and password, or oauth in place of password. |
mail_on:
failure: true
error_mail:
from: alerts@example.com
to: oncall@example.com
prefix: "[ALERT]"
smtp:
host: smtp.example.com
port: "587"
username: alerts@example.com
password: ${env.SMTP_PASSWORD}See Email Notifications for OAuth providers.
Lifecycle Handlers
handler_on holds one step per event. Handlers take the normal step fields and defaults.
| Event | Runs |
|---|---|
init | Before the first step, after DAG preconditions pass. A failure fails the run. |
success | After the run succeeds. |
failure | After the run fails. |
abort | After the run is stopped. |
wait | When a step starts waiting for a person. |
exit | Last, after every other handler. |
See Lifecycle Handlers.
Step Fields
steps is a list. In type: chain, a nested list is a group of steps that run in parallel.
Step Identity
| Field | Type | Description |
|---|---|---|
id | string | Name used in references such as ${steps.build.outputs.image}. Up to 40 characters matching ^[a-zA-Z][a-zA-Z0-9_]*$, so load_data, not load-data. env, params, args, stdout, stderr, output, and outputs are reserved. |
name | string | Display name. Generated when omitted. |
description | string | What the step does. |
depends | string or list | Steps by id or name that must finish first. Not in type: chain. |
Execution
| Field | Type | Default | Description |
|---|---|---|---|
run | string | Shell command or script. Not with action. See Shell. | |
action | string | Action to run, with inputs in with. See Built-In Actions. | |
with | map | Inputs of action. For run, only shell, shell_args, and shell_packages. | |
env | list or map | Environment for this step, over the DAG's. | |
working_dir | string | DAG working_dir | Resolved when the step starts, so it can read an earlier step's output. |
timeout_sec | integer | Time limit for this step. | |
signal_on_stop | string | Signal Dagu received | Signal sent when the run is stopped, such as SIGINT. |
mail_on_error | boolean | false | Send the error email if this step fails. |
dependencies | string or list | Files, directories, or globs copied into the run's work directory, for local and distributed runs. See File Dependencies. | |
secrets | list | Names from the DAG's secrets that this step receives. Once any step has the list, a step without one receives no secrets. Not in defaults or foreach. | |
untrusted | boolean | false | Marks a step that runs agent-controlled code. It receives no secrets and no DAGU_ variable except DAGU_OUTPUT_FILE, and runs as the restricted user when the server sets untrusted.uid and untrusted.gid. For run and harness.run. See Untrusted Steps. |
steps:
- id: build
run: |
npm ci
npm run build
with:
shell: bash
shell_args: [-e, -o, pipefail]Step-Level Container
A step's container takes the same forms as the DAG-level one and runs that step in its own container.
steps:
- id: test
container:
image: python:3.13-slim
run: pytestBuilt-In Actions
| Actions | Purpose |
|---|---|
a2a.send, a2a.get_task | Call a remote A2A agent |
archive.create, archive.extract, archive.list | Archives |
artifact.list, artifact.read, artifact.write | Run artifacts |
browser.run, browser.extract | Browser automation |
chat.completion | LLM completion |
clickhouse.query | ClickHouse |
computer.run, computer.extract | Desktop automation |
container.run, docker.run | Run a container |
dag.run, dag.enqueue | Start a child DAG |
data.convert, data.pick, data.filter | Data conversion |
decision.evaluate | Typed model decisions |
exec | Run a program without a shell. See Direct Exec. |
file.copy, file.delete, file.list, file.mkdir, file.move, file.read, file.stat, file.write | Files |
git.checkout, git.worktree.add, git.worktree.remove | Git |
harness.run | Coding agent through a harness |
http.request | HTTP |
human.task | Wait for a person. See Human Task. |
jq.filter | jq |
js.run | Sandboxed JavaScript |
kubernetes.run, k8s.run | Kubernetes Job |
log.write | Log a message |
mail.send, mail.search, mail.organize | Mail and mailboxes |
mcp.call | Call an MCP tool |
noop | Placeholder |
outputs.write | Publish outputs |
postgres.query, postgres.import | PostgreSQL |
redis.<command> | Redis |
router.route | Route to steps by value |
s3.upload, s3.download, s3.list, s3.delete | S3 |
sftp.upload, sftp.download | SFTP |
sqlite.query, sqlite.import | SQLite |
ssh.run | Remote command over SSH |
state.get, state.set, state.delete, state.list, state.diff | Persistent state |
template.render | Templates |
wait.duration, wait.until, wait.file, wait.http | Wait for time or a condition |
xlsx.* | Excel workbooks: read, info, list_sheets, write, append, update_rows, validate, write_cells, sheet, convert, extract |
DuckDB is an official action package, duckdb@v1.
Direct Exec
action: exec runs a program with explicit arguments and no shell parsing. with.command is required; with.args takes strings, numbers, and booleans.
steps:
- action: exec
with:
command: python3
args: [-u, app.py, --limit, 10]Child DAG Actions
dag.run starts a child DAG and waits for it. dag.enqueue queues it and continues, and also accepts with.queue.
steps:
- id: run_child
action: dag.run
with:
dag: child_workflow
params:
mode: full| Field | Type | Description |
|---|---|---|
with.dag, with.params | string; string or map | The child DAG and its parameters. |
pass_env | boolean or list | true passes the parent's own environment, without secrets or host values; a list passes the named variables. Not with dag.enqueue. |
worker_selector | map | Labels of the worker that runs the child. |
See Sub-DAGs.
Parallel Child DAG Runs
parallel runs a dag.run or dag.enqueue step once per item. Each child reads its item as ITEM.
| Field | Type | Default | Description |
|---|---|---|---|
items | list or string | Required | A list, or a reference whose value is a list or a delimited string. |
separator | string | Detected | newline, comma, semicolon, pipe, tab, or space, for a string items. |
max_concurrent | integer | defaults.max_concurrent, else 10 | Child runs at once, up to 1000. |
steps:
- action: dag.run
with:
dag: file_processor
params: "file=${ITEM}"
parallel:
items: [a.csv, b.csv, c.csv]
max_concurrent: 2Human Task
action: human.task waits, without running a process, until a person completes it in the Web UI, API, or CLI.
steps:
- id: release_review
action: human.task
with:
prompt: Choose the release target
form:
type: object
properties:
environment:
type: string
enum: [staging, production]
required: [environment]
- id: deploy
run: ./deploy.sh "${steps.release_review.outputs.environment}"| Field | Required | Description |
|---|---|---|
id | Yes | Used to complete the task and to read its outputs. |
with.prompt | Yes | Instructions, rendered as Markdown. |
with.form | No | Flat JSON Schema of string, integer, number, and boolean properties. Each property becomes ${steps.<id>.outputs.<property>}. |
with.artifacts | No | Artifact paths shown as context. |
with.push_back.rewind_to | With push_back | Upstream step to run again when the person sends the task back. |
with.push_back.form | No | Feedback form passed to the rewound steps. |
Only root DAGs can have a human task, and not in foreach or a handler. See Human Tasks.
Nodes
nodes runs a step once on every inventory node a label selector matches, such as web,env=prod.
| Field | Type | Default | Description |
|---|---|---|---|
nodes | string, list, or map | The selector, or a map with the fields below. | |
nodes.labels | string or list | Required in the map | Selector terms. |
nodes.max_concurrent | integer | 1 | Nodes at once, up to 1000. |
nodes.keep_going | boolean | false | Continue with other nodes after one fails. |
Valid on command steps (run, ssh.run, and sftp.*) and on dag.run, whose child DAG must set node: required. Not with parallel, foreach, worker_selector, container, or repeat_policy. See Node Targeting.
Foreach
foreach runs inline body steps once per item, without a child DAG. Not with run, action, or parallel.
| Field | Type | Default | Description |
|---|---|---|---|
items | list or string | Required | A list, or a reference to a JSON array. |
steps | list | Required | Body steps. |
as | string | item | Name of the item in the foreach namespace. |
key | string | Index | Stable key per item. |
max_concurrent | integer | defaults.max_concurrent, else 10 | Bodies at once, up to 1000. |
collect | map | Output names mapped to expressions read from each successful body. |
steps:
- id: per_region
foreach:
items: [us, eu, ap]
steps:
- id: check
run: printf 'status=ok-%s\n' "${foreach.item}" >> "$DAGU_OUTPUT_FILE"
outputs:
- name: status
collect:
status: ${steps.check.outputs.status}Body steps read the item as ${foreach.item}, or under the as name, with ${foreach.index} and ${foreach.key}. See Control Flow.
Output
| Field | Type | Description |
|---|---|---|
outputs | list | Declared outputs, each with name and type (string or json), written to $DAGU_OUTPUT_FILE. In type: build, path instead of type. See Outputs. |
output | string or map | A string captures stdout into a variable. A map publishes structured outputs; see Object-Form output. |
output_schema | map | Inline JSON Schema that stdout JSON must match. On chat.completion, the shape the model answers in. |
inputs | list | Build inputs, each with name and path. See Build Workflows. |
stdout | string or map | A file path, or artifact: for a path in the run's artifacts, or outputs: to publish stdout from an action package. |
stderr | string or map | A file path, or artifact:. |
stdin | string | File piped to standard input of a run step. See Standard Input. |
log_output | string | separate or merged, overriding the DAG's. |
steps:
- id: report
run: ./generate-report
stdout:
artifact: reports/report.mdConditions and Continuation
preconditions at the top level gate the whole run; on a step, they gate that step. continue_on lets the run continue after a step fails or is skipped.
| Precondition field | Description |
|---|---|
condition | With expected, a value to compare. Without it, a command that must exit 0. |
eval | A value computed with $(...) or backticks, compared with expected. |
expected | Exact text, re:<regex>, or num:>=<n> style comparison. Required with eval. |
negate | Invert the result. |
continue_on field | Description |
|---|---|
failure, skipped | Continue after a failure or a skip. The string failed or skipped is shorthand. |
exit_code | Exit codes that count as continuable. |
output | Text or re: patterns in stdout that count as continuable. |
mark_success | Record the step as succeeded. |
steps:
- id: deploy
run: ./deploy.sh
preconditions:
- condition: "${env.ENVIRONMENT}"
expected: production
- id: optional
run: ./optional.sh
continue_on:
exit_code: [1, 2]
mark_success: trueSee Control Flow.
Retry and Repeat
retry_policy field | Type | Description |
|---|---|---|
limit | integer or string | Retries after the first failure. Required. |
interval_sec | integer or string | Base delay. Required. |
backoff | boolean or number | Multiplier per retry. true is 2.0. |
max_interval_sec | integer | Upper bound for the delay. |
exit_code | list | Exit codes that trigger a retry. Default: any non-zero. |
repeat_policy field | Type | Description |
|---|---|---|
repeat | string or boolean | while repeats while the step succeeds or the condition holds; until repeats until it does. true is while. |
condition, expected | string | What to check after each execution. Without them, the exit status. |
exit_code | list | Exit codes that decide the repeat. |
interval_sec, backoff, max_interval_sec | Delay between executions. | |
limit | integer | Executions at most. Without it, the step repeats until stopped. |
on_limit | string | succeed (default) or fail for an until loop that hits limit. |
steps:
- run: curl -fsS https://api.example.com/health
retry_policy:
limit: 5
interval_sec: 2
backoff: true
- run: ./check-job.sh
repeat_policy:
repeat: until
interval_sec: 30
limit: 20Each execution reads its index as ${context.step.repeat_index}. See Durable Execution and Control Flow.
Approval
approval runs the step, then waits for a person to approve before later steps start.
| Field | Description |
|---|---|
prompt | Message shown to the approver. |
input | Names of values to collect. They become environment variables of later steps. |
required | Values from input that must be filled. |
rewind_to | Step to run again when the approver pushes back. |
steps:
- id: deploy_prod
run: ./deploy.sh production
approval:
prompt: Approve the production deploy?
input: [APPROVED_BY]
required: [APPROVED_BY]See Approval.
Values and Variables
Fields read values through references such as ${params.region}, ${env.NAME}, ${steps.build.outputs.image}, and ${context.run.id}. Which fields resolve them, and when, is on Variables Reference. Run metadata is on Runtime Variables, and quoting rules on Quoting and Escaping.
Deprecated Fields
These fields still load, but new workflows should use the replacement.
Legacy Execution Fields
| Step field | Use instead |
|---|---|
command, script | run |
exec | action: exec |
shell, shell_args, shell_packages | The same keys under with on a run step |
type | action |
config | with |
call, params | action: dag.run with with.dag and with.params |
messages, llm | action: chat.completion with with |
value, routes | action: router.route with with |
run as a list | A string run |
| Top-level field | Use instead |
|---|---|
tags | labels |
step_types | actions |
max_active_runs | queue, with concurrency set on a server queue. Ignored for local queues. |
Common Mistakes
- Step IDs cannot contain hyphens.
runandactioncannot be used together.mail.sendtakesmessage, notbody.output_schemais an inline schema, not a file path.- Listing
dotenvfiles does not stop.envfrom loading.dotenv: []does. max_active_steps: 0means no limit.

