dag build
Assemble a .dag.json workflow file from a structured IBuildSpec JSON definition. Use this command when you want precise control over node configuration and edge wiring without writing raw DAG JSON by hand.
Synopsis
bash
dag build --spec '<IBuildSpec JSON>' [--dagId <id>] [--output <path>] [--run] [--strict]
dag build --spec path/to/spec.json [--dagId <id>] [--output <path>] [--run] [--strict]IBuildSpec Format
An IBuildSpec object has two top-level keys:
nodesAn array of node descriptors. Each descriptor has anid(unique within the DAG) and atype(a registered node type name). Optionalconfigkeys set node-level parameters.edgesAn array of edge strings using the arrow syntaxsourceId→targetId(U+2192, the rightwards arrow character). The arrow connects the default output port of the source to the default input port of the target.
json
{
"nodes": [
{ "id": "input", "type": "input" },
{ "id": "transform", "type": "llm-text-anthropic" },
{ "id": "output", "type": "text-output" }
],
"edges": [
"input→transform",
"transform→output"
]
}Inline Spec Example
Pass the spec as an inline JSON string. Use single quotes on Unix shells to avoid escaping issues.
bash
dag build \
--spec '{"nodes":[{"id":"input","type":"input"},{"id":"transform","type":"llm-text-anthropic"},{"id":"output","type":"text-output"}],"edges":["input→transform","transform→output"]}' \
--dagId my-dag \
--output my-dag.dag.jsonFile Spec Example
For larger specs, save the JSON to a .json or .spec file and pass the path to --spec.
bash
dag build --spec pipeline.spec --dagId my-dag --output my-dag.dag.json --runFlags
| Flag | Description |
|---|---|
| --spec <json|path> | Inline JSON string or path to a .json / .spec file containing the IBuildSpec definition. |
| --dagId <id> | Assign a custom identifier to the generated DAG. Defaults to a generated slug. |
| --output <path> | Write the generated .dag.json file to this path. Defaults to stdout. |
| --run | Execute the generated DAG immediately after building. |
| --strict | Fail immediately if any node type is unrecognised or any required port is unconnected. |