Skip to content

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:

bash
dagu schema dag                   # top-level fields
dagu schema dag steps             # step fields
dagu schema dag steps.container   # one nested block

Minimal Workflow ​

yaml
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 ​

yaml
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 ​

FieldPurpose
actionsReusable custom actions
artifactsPer-run artifact storage
calendarBusiness calendar for start schedules
catchup_windowReplay missed runs after downtime
constsValues fixed at load time
containerShared container for the run
datesDates derived from the schedule slot
defaultsDefault step settings
delay_secWait before the first step
descriptionWhat the DAG does
dotenv.env files to load
envEnvironment for every step
error_mailFailure email settings
groupGroup name in the UI
handler_onSteps for run events
harnessDefaults for harness.run
harnessesCustom coding-agent CLIs
hist_retention_daysDays of history to keep
hist_retention_runsNumber of runs to keep
info_mailSuccess email settings
kubernetesDefaults for kubernetes.run
labelsLabels for filtering and workspaces
llmDefaults for model steps
log_dirLog directory
log_outputSeparate or merged stdout and stderr logs
mail_accountsMailboxes for mail actions
mail_onWhen to send email
max_active_stepsSteps running at once
max_clean_up_time_secCleanup time before a forced stop
max_output_sizeCaptured output limit per step
nameDAG name
nodeRequire a bound node
otelOpenTelemetry tracing
outputsNamed results of the DAG
overlap_policyCatch-up runs while one is running
paramsRun inputs
preconditionsChecks before any step runs
queueQueue the run joins
redisDefaults for redis.* actions
registry_authsPrivate container registry credentials
resourcesCPU and memory limits
restart_policyKeep the DAG running like a service
restart_wait_secWait between service runs
retry_policyRetry the whole run
run_configLock fields in the start dialog
s3Defaults for s3.* actions
scheduleWhen the DAG runs
secretsSecrets exposed as environment variables
shellDefault shell for run
shell_argsExtra shell arguments
skip_if_successfulSkip a slot that already succeeded
slot_retention_daysDays to keep schedule slot records
smtpMail server
sshDefault SSH connection
stepsThe work
tasksGoals of an agent DAG
timeout_secTime limit for the run
toolsPinned CLI tools
typeHow steps are scheduled
wait_mailWaiting email settings
watchStart a run per arriving file
webhookWebhook header forwarding
worker_selectorWorker labels for the run
working_dirWorking directory

Deprecated: max_active_runs, step_types, tags. See Deprecated Fields.

Step Fields ​

FieldPurpose
actionBuilt-in, custom, or remote action
approvalWait for approval after the step runs
containerRun the step in a container
continue_onKeep going after failure or skip
dependenciesFiles copied into the run
dependsSteps that must finish first
descriptionWhat the step does
envEnvironment for this step
foreachRun body steps per item
idIdentifier for references
inputsBuild inputs
log_outputSeparate or merged logs
mail_on_errorEmail when the step fails
nameStep name
nodesRun once per inventory node
outputCapture stdout into a variable
output_schemaValidate stdout JSON
outputsDeclared outputs
parallelFan out child runs
pass_envEnvironment passed to a child run
preconditionsChecks before the step
repeat_policyRun the step repeatedly
retry_policyRetry a failed step
runShell command or script
secretsSecrets this step receives
signal_on_stopSignal sent when stopped
stderrWrite stderr to a file or artifact
stdinFile piped to standard input
stdoutWrite stdout to a file, artifact, or outputs
timeout_secTime limit for the step
untrustedIsolate agent-controlled code
withAction inputs, or shell options for run
worker_selectorWorker labels for a child run
working_dirStep 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 ​

FieldTypeDefaultDescription
namestringFile nameUp to 40 characters matching ^[a-zA-Z0-9_.-]+$.
descriptionstringShown in the UI and to agents.
groupstringGroups related DAGs in the UI.
labelsstring, list, or mapteam=data, [nightly, team=data], or {team: data}. workspace=<name> puts the DAG in a workspace.

Execution Mode ​

FieldTypeDefaultDescription
typestringgraphgraph 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.
taskslistGoals of a type: agent DAG, each with name and description. Required with type: agent and invalid otherwise.
yaml
type: chain

steps:
  - run: echo "first"
  - run: echo "second"

Scheduling ​

FieldTypeDefaultDescription
schedulestring, list, or mapCron expressions, aliases such as @daily, one-off at times, or a start/stop/restart map. See Scheduling.
calendarstringBusiness calendar for start entries that name none: weekdays, a calendar file, or none.
datesmapDates derived from the schedule slot, read as ${dates.NAME}. See Schedule Dates.
skip_if_successfulbooleanfalseSkip a scheduled run when the DAG already succeeded since the previous scheduled time. Manual runs always run.
catchup_windowdurationHow far back to replay missed runs after scheduler downtime, such as 6h or 2d12h. Omit to replay none.
overlap_policystringskipA catch-up run while the DAG is running: skip, all, or latest.
restart_policystringnoalways or unless-stopped keeps a run alive like a service. Not with schedule or a DAG retry_policy. See Services.
restart_wait_secinteger0With restart_policy, seconds between one run's end and the next start, at least 1.
watchmapStart a run for each file that arrives: path (required), pattern, and interval (default 10s). See Watched Folders.
yaml
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, and business_days. Stop and restart entries take cron only.
  • at is an RFC 3339 time with an offset or Z, and seconds of :00.
  • profile makes an entry fire only when it names the DAG's default runtime profile.

Execution Control ​

FieldTypeDefaultDescription
queuestringDAG nameQueue from the server configuration. See Queues.
max_active_stepsinteger0Steps running at once in one run. 0 or less is unlimited; -1 clears a base-config value.
timeout_secinteger0Time limit for the whole run. 0 is none.
delay_secinteger0Seconds to wait before the first step.
max_clean_up_time_secinteger5Seconds to stop steps and finish logs before processes are killed.
preconditionsstring or listChecks before any step. See Conditions and Continuation.
retry_policymapRetries the whole run. See DAG Retry Policy.
run_configmapdisable_param_edit and disable_run_id_edit, both false by default, lock those inputs in the start dialog. See Parameters.
worker_selectormap or localLabels a worker must have, such as {gpu: "true"}, or local to run on the server. Values can use ${params.*} and ${env.*}.
nodestringrequired makes the DAG run only bound to one node. See Node Targeting.
resourcesmaplimits.cpu and limits.memory for the whole run. See DAG Run Resource Limits.

yaml
run_config:
  disable_param_edit: true
  disable_run_id_edit: true

Top-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.

FieldTypeDefaultDescription
limitinteger or stringRequiredRetries after the first failure. 0 turns them off.
interval_secinteger or string60Base delay before a retry.
backoffboolean or numberMultiplier per retry. true is 2.0.
max_interval_secinteger or string3600Upper bound for the delay.

History and Output Limits ​

FieldTypeDefaultDescription
hist_retention_daysinteger30Days of run history to keep. A DAG with restart_policy keeps its latest 100 runs instead.
hist_retention_runsintegerNumber of runs to keep. Not with hist_retention_days.
slot_retention_daysinteger730Days to keep each schedule slot's record, which backfill reads.
max_output_sizeinteger1048576Bytes of stdout one step can capture. A step that captures more fails.
log_dirstringpaths.log_dirDirectory for this DAG's logs.
log_outputstringseparateseparate writes .out and .err files; merged writes one .log.

Data, Environment, and Files ​

FieldTypeDefaultDescription
constslistValues fixed at load time, read as ${consts.name}. See Constants.
paramsstring, list, or mapRun inputs. See Parameters.
envlist or mapEnvironment for every step, evaluated in order. See Environment Variables.
dotenvstring or list.envExtra .env files, loaded after .env. [] turns loading off. See Dotenv Files.
secretslistSecrets exposed as masked environment variables. Each entry has name and either ref, or provider with key and options. See Secrets.
outputsmapNamed results of the DAG. See DAG Outputs.
working_dirstringPer-run work directoryWorking directory of every step. A relative path resolves from the DAG file's directory. See Per-Run Work Directory.
shellstring or listSystem defaultDefault shell for run, such as bash -e or ["bash", "-e"].
shell_argslistArguments added to the DAG shell.
toolslist or mapPinned CLI tools installed before the run. See Tools.
artifactsmapOn when usedPer-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.

yaml
outputs:
  summary: ${steps.diagnose.outputs.summary}

steps:
  - id: diagnose
    run: printf 'summary=%s\n' "disk at 91%" >> "$DAGU_OUTPUT_FILE"
    outputs:
      - name: summary

Root 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 ​

yaml
params:
  - name: region
    type: string
    default: us-east-1
    enum: [us-east-1, us-west-2]
  - name: count
    type: integer
    default: 3
    minimum: 1
FieldTypeDescription
namestringRequired.
typestringstring, integer, number, or boolean.
defaultscalarLiteral default.
evalstringComputes the default when the run starts. See Computed Defaults.
title, descriptionstringLabel and help text in the start dialog.
requiredbooleanRequires a value when there is no default.
enumlistAllowed values.
minimum, maximumnumberNumeric bounds.
min_length, max_lengthintegerString length bounds.
patternstringRE2 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.

FieldMerge with the step's own value
retry_policy, repeat_policy, continue_on, timeout_sec, mail_on_error, signal_on_stopThe step's value replaces the default.
env, preconditionsDefault entries come first, then the step's.
max_concurrentUsed by parallel and foreach steps without one, from 1 to 1000.

See Step Defaults.

Custom Actions ​

FieldTypeDescription
actionsmapActions 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 ​

FieldTypeDescription
containerstring or mapShared container for the run. See Container.
registry_authsstring or mapCredentials for private registries, as a DOCKER_AUTH_CONFIG JSON string or a map by registry host. See Private Registries.
sshmapRuns every run step on a remote host, and is the default connection of ssh.run and sftp.*. See SSH.
s3mapDefaults for s3.* actions. See S3.
llmmapDefaults for chat.completion, or the model of an agent DAG. See LLM.
redismapDefaults for redis.* actions. See Redis.
kubernetesmapDefaults for kubernetes.run. See Kubernetes.
harnessmapDefaults for harness.run: provider, model, fallback, and other provider options. See Harness.
harnessesmapCustom coding-agent CLIs that harness.run names in with.provider.
mail_accountsmapMailboxes keyed by address, used by mail.search, mail.organize, and mail.send. See Mail Accounts.
otelmapTracing: enabled, endpoint, headers, insecure, timeout, and resource. See OpenTelemetry.
webhookmapforward_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.

yaml
container:
  image: python:3.13-slim
  volumes:
    - ./data:/data
  env:
    - PYTHONUNBUFFERED: "1"
FieldDefaultDescription
imageImage to run. Not with exec.
execRunning container to exec into. With it, only user, working_dir, env, env_file, and shell apply.
pull_policymissingalways, missing, never, fallback, or a boolean.
env, env_fileContainer environment, and dotenv files loaded into it.
volumeshost:container[:ro]. Relative host paths resolve from working_dir.
working_dir, user, shellDirectory, user, and shell inside the container. shell is a list.
ports, network, platform, nameDocker settings for the container.
startupkeepalivekeepalive, entrypoint, or command with command.
wait_forrunningrunning or healthy. healthcheck sets a check for images without one.
log_patternRegular expression to wait for in the logs.
restart_policy, keep_containerDocker restart policy, and keep the container after the run.

Not with a DAG-level ssh. See Container for behavior and step-level containers.

SSH ​

yaml
ssh:
  user: deploy
  host: app.example.com
  key: ~/.ssh/id_ed25519

steps:
  - id: status
    run: systemctl status myapp

status 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 ​

yaml
llm:
  provider: anthropic
  model: claude-sonnet-4-5

Fields: 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 ​

FieldTypeDescription
mail_onmapsuccess, failure, and wait, each true to send email.
error_mail, info_mail, wait_mailmapfrom, to, prefix, and attach_logs for failure, success, and waiting email.
smtpmaphost, port, username, and password, or oauth in place of password.
yaml
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.

EventRuns
initBefore the first step, after DAG preconditions pass. A failure fails the run.
successAfter the run succeeds.
failureAfter the run fails.
abortAfter the run is stopped.
waitWhen a step starts waiting for a person.
exitLast, 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 ​

FieldTypeDescription
idstringName 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.
namestringDisplay name. Generated when omitted.
descriptionstringWhat the step does.
dependsstring or listSteps by id or name that must finish first. Not in type: chain.

Execution ​

FieldTypeDefaultDescription
runstringShell command or script. Not with action. See Shell.
actionstringAction to run, with inputs in with. See Built-In Actions.
withmapInputs of action. For run, only shell, shell_args, and shell_packages.
envlist or mapEnvironment for this step, over the DAG's.
working_dirstringDAG working_dirResolved when the step starts, so it can read an earlier step's output.
timeout_secintegerTime limit for this step.
signal_on_stopstringSignal Dagu receivedSignal sent when the run is stopped, such as SIGINT.
mail_on_errorbooleanfalseSend the error email if this step fails.
dependenciesstring or listFiles, directories, or globs copied into the run's work directory, for local and distributed runs. See File Dependencies.
secretslistNames 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.
untrustedbooleanfalseMarks 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.
yaml
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.

yaml
steps:
  - id: test
    container:
      image: python:3.13-slim
    run: pytest

Built-In Actions ​

ActionsPurpose
a2a.send, a2a.get_taskCall a remote A2A agent
archive.create, archive.extract, archive.listArchives
artifact.list, artifact.read, artifact.writeRun artifacts
browser.run, browser.extractBrowser automation
chat.completionLLM completion
clickhouse.queryClickHouse
computer.run, computer.extractDesktop automation
container.run, docker.runRun a container
dag.run, dag.enqueueStart a child DAG
data.convert, data.pick, data.filterData conversion
decision.evaluateTyped model decisions
execRun a program without a shell. See Direct Exec.
file.copy, file.delete, file.list, file.mkdir, file.move, file.read, file.stat, file.writeFiles
git.checkout, git.worktree.add, git.worktree.removeGit
harness.runCoding agent through a harness
http.requestHTTP
human.taskWait for a person. See Human Task.
jq.filterjq
js.runSandboxed JavaScript
kubernetes.run, k8s.runKubernetes Job
log.writeLog a message
mail.send, mail.search, mail.organizeMail and mailboxes
mcp.callCall an MCP tool
noopPlaceholder
outputs.writePublish outputs
postgres.query, postgres.importPostgreSQL
redis.<command>Redis
router.routeRoute to steps by value
s3.upload, s3.download, s3.list, s3.deleteS3
sftp.upload, sftp.downloadSFTP
sqlite.query, sqlite.importSQLite
ssh.runRemote command over SSH
state.get, state.set, state.delete, state.list, state.diffPersistent state
template.renderTemplates
wait.duration, wait.until, wait.file, wait.httpWait 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.

yaml
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.

yaml
steps:
  - id: run_child
    action: dag.run
    with:
      dag: child_workflow
      params:
        mode: full
FieldTypeDescription
with.dag, with.paramsstring; string or mapThe child DAG and its parameters.
pass_envboolean or listtrue passes the parent's own environment, without secrets or host values; a list passes the named variables. Not with dag.enqueue.
worker_selectormapLabels 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.

FieldTypeDefaultDescription
itemslist or stringRequiredA list, or a reference whose value is a list or a delimited string.
separatorstringDetectednewline, comma, semicolon, pipe, tab, or space, for a string items.
max_concurrentintegerdefaults.max_concurrent, else 10Child runs at once, up to 1000.
yaml
steps:
  - action: dag.run
    with:
      dag: file_processor
      params: "file=${ITEM}"
    parallel:
      items: [a.csv, b.csv, c.csv]
      max_concurrent: 2

Human Task ​

action: human.task waits, without running a process, until a person completes it in the Web UI, API, or CLI.

yaml
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}"
FieldRequiredDescription
idYesUsed to complete the task and to read its outputs.
with.promptYesInstructions, rendered as Markdown.
with.formNoFlat JSON Schema of string, integer, number, and boolean properties. Each property becomes ${steps.<id>.outputs.<property>}.
with.artifactsNoArtifact paths shown as context.
with.push_back.rewind_toWith push_backUpstream step to run again when the person sends the task back.
with.push_back.formNoFeedback 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.

FieldTypeDefaultDescription
nodesstring, list, or mapThe selector, or a map with the fields below.
nodes.labelsstring or listRequired in the mapSelector terms.
nodes.max_concurrentinteger1Nodes at once, up to 1000.
nodes.keep_goingbooleanfalseContinue 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.

FieldTypeDefaultDescription
itemslist or stringRequiredA list, or a reference to a JSON array.
stepslistRequiredBody steps.
asstringitemName of the item in the foreach namespace.
keystringIndexStable key per item.
max_concurrentintegerdefaults.max_concurrent, else 10Bodies at once, up to 1000.
collectmapOutput names mapped to expressions read from each successful body.
yaml
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 ​

FieldTypeDescription
outputslistDeclared outputs, each with name and type (string or json), written to $DAGU_OUTPUT_FILE. In type: build, path instead of type. See Outputs.
outputstring or mapA string captures stdout into a variable. A map publishes structured outputs; see Object-Form output.
output_schemamapInline JSON Schema that stdout JSON must match. On chat.completion, the shape the model answers in.
inputslistBuild inputs, each with name and path. See Build Workflows.
stdoutstring or mapA file path, or artifact: for a path in the run's artifacts, or outputs: to publish stdout from an action package.
stderrstring or mapA file path, or artifact:.
stdinstringFile piped to standard input of a run step. See Standard Input.
log_outputstringseparate or merged, overriding the DAG's.
yaml
steps:
  - id: report
    run: ./generate-report
    stdout:
      artifact: reports/report.md

Conditions 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 fieldDescription
conditionWith expected, a value to compare. Without it, a command that must exit 0.
evalA value computed with $(...) or backticks, compared with expected.
expectedExact text, re:<regex>, or num:>=<n> style comparison. Required with eval.
negateInvert the result.
continue_on fieldDescription
failure, skippedContinue after a failure or a skip. The string failed or skipped is shorthand.
exit_codeExit codes that count as continuable.
outputText or re: patterns in stdout that count as continuable.
mark_successRecord the step as succeeded.
yaml
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: true

See Control Flow.

Retry and Repeat ​

retry_policy fieldTypeDescription
limitinteger or stringRetries after the first failure. Required.
interval_secinteger or stringBase delay. Required.
backoffboolean or numberMultiplier per retry. true is 2.0.
max_interval_secintegerUpper bound for the delay.
exit_codelistExit codes that trigger a retry. Default: any non-zero.
repeat_policy fieldTypeDescription
repeatstring or booleanwhile repeats while the step succeeds or the condition holds; until repeats until it does. true is while.
condition, expectedstringWhat to check after each execution. Without them, the exit status.
exit_codelistExit codes that decide the repeat.
interval_sec, backoff, max_interval_secDelay between executions.
limitintegerExecutions at most. Without it, the step repeats until stopped.
on_limitstringsucceed (default) or fail for an until loop that hits limit.
yaml
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: 20

Each 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.

FieldDescription
promptMessage shown to the approver.
inputNames of values to collect. They become environment variables of later steps.
requiredValues from input that must be filled.
rewind_toStep to run again when the approver pushes back.
yaml
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 fieldUse instead
command, scriptrun
execaction: exec
shell, shell_args, shell_packagesThe same keys under with on a run step
typeaction
configwith
call, paramsaction: dag.run with with.dag and with.params
messages, llmaction: chat.completion with with
value, routesaction: router.route with with
run as a listA string run
Top-level fieldUse instead
tagslabels
step_typesactions
max_active_runsqueue, with concurrency set on a server queue. Ignored for local queues.

Common Mistakes ​

  • Step IDs cannot contain hyphens.
  • run and action cannot be used together.
  • mail.send takes message, not body.
  • output_schema is an inline schema, not a file path.
  • Listing dotenv files does not stop .env from loading. dotenv: [] does.
  • max_active_steps: 0 means no limit.

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