Top-level structure
A minimal DAG file needs only aname and a nodes list. Every other top-level field is optional and adds progressively more behaviour.
Fields reference
The identifier for this workflow. Used in run logs and trace spans. Must be unique across your workflow library.
A human-readable summary of what the workflow does. Shown by
agentgraph validate and in run listings.The ordered list of node specifications. Node execution order is determined by dependency edges, not list order. See Node types for all available types and their fields.
inputs — declare workflow parameters
inputs — declare workflow parameters
The Pass inputs at run time:
inputs map declares the parameters your workflow accepts from the CLI or a webhook call. Each key is the input name; the value is a schema object.One of
string, integer, number, or boolean. Defaults to string. dagraph coerces the raw CLI string to this type before the first node runs, so a typo like --input count=three fails immediately with a clear error.Whether the input must be provided. Defaults to
true. Set to false and provide a default for optional parameters.Default value used when the input is absent and
required: false.Documents the parameter. Displayed by
agentgraph validate to self-document the DAG.budget — cap token and dollar spend
budget — cap token and dollar spend
The You can also set a per-node budget on any individual node using the same
budget block sets a hard upper limit on the entire run. If either limit is reached, dagraph stops all in-flight nodes immediately and marks the run as failed.Maximum number of billable tokens (input + output) across all nodes. Cache-creation overhead from the
claude_code backend is excluded.Maximum equivalent API cost in US dollars. Useful when mixing models with different per-token prices.
budget: field. See Node types for details.outputs — write node results to files
outputs — write node results to files
The
outputs map writes the text output of specific nodes to files on disk after a successful run. Nothing is written for paused or failed runs.Maps an output file path (relative to the working directory) to a node ID. The node’s text output is written to that path when the run completes successfully. Parent directories are created automatically.
hooks — lifecycle callbacks
hooks — lifecycle callbacks
The
hooks map attaches callbacks to DAG lifecycle events. Hook failures never fail the DAG itself.Supported events:
on_dag_start, on_dag_complete, on_dag_paused, on_dag_failed. Each value is a list of hook specifications — either a webhook (JSON POST) or a shell command.Template variables
dagraph uses Jinja2 to render prompts and commands at run time. Two scopes of variables are available inside any prompt or command string.Input variables
Reference any declared input by name:Upstream node outputs
Reference the text output of any completed upstream node by itsid:
map node), you can iterate over it:
dagraph’s Jinja environment uses
StrictUndefined, so a typo in a variable name will fail the node immediately with a clear error message rather than silently inserting an empty string.Externalising prompts with prompt_file and system_file
Long prompts are easier to read, review, and diff when stored in separate text files. Use prompt_file instead of prompt, and system_file instead of system. Paths resolve relative to the directory containing the YAML file.