You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(skill): condense reference files for conciseness
Reduce total skill reference from 2311 to 1365 lines (41%) by trimming
verbose examples, merging redundant sections, and dropping niche config
details while preserving all essential DAG authoring information.
@@ -4,7 +4,7 @@ description: Writes, validates, and debugs Dagu DAG workflow definitions in YAML
4
4
---
5
5
# Dagu DAG Authoring Reference
6
6
7
-
Dagu runs workflows defined as DAGs in YAML. Each YAML file defines steps with commands, dependencies, and executor configurations. This reference covers everything needed to write correct DAG files.
7
+
Dagu runs workflows defined as DAGs in YAML. Each YAML file defines steps with commands, dependencies, and executor configurations.
8
8
9
9
## Execution Types
10
10
@@ -13,27 +13,18 @@ Dagu runs workflows defined as DAGs in YAML. Each YAML file defines steps with c
13
13
|`chain` (default) | Steps run sequentially in definition order. `depends:` is not allowed. |
14
14
|`graph`| Steps run based on `depends:` declarations. Steps without `depends:` run immediately in parallel. |
15
15
16
-
**Always use `type: graph`**in DAG definitions. It supports both sequential (via `depends:`) and parallel execution, making it strictly more capable than `chain`. Every DAG you write should include `type: graph` at the top level.
16
+
**Always use `type: graph`**— it supports both sequential (via `depends:`) and parallel execution, making it strictly more capable than `chain`.
17
17
18
18
## Step Identity: `id` vs `name`
19
19
20
-
**Always set `id` on every step. Omit `name` — it is redundant.** When `name` is omitted, it is automatically set to the `id` value. When both are omitted, a name is auto-generated (e.g., `cmd_1`, `docker_1`), but the step cannot be referenced by other steps.
20
+
**Always set `id` on every step. Omit `name` — it is redundant.** When `name` is omitted, it defaults to the `id` value. Without both, a name is auto-generated but the step cannot be referenced.
21
21
22
-
The `id` field is required for:
23
-
- Referencing step outputs via `${step_id.stdout}`, `${step_id.stderr}`, `${step_id.exit_code}`
24
-
- Dependencies via `depends: [step_id]`
22
+
`id` is required for output references (`${step_id.stdout}`, `${step_id.exit_code}`) and dependencies (`depends: [step_id]`).
25
23
26
-
**Step ID rules:**
27
-
- Regex: `^[a-zA-Z][a-zA-Z0-9_]*$`
28
-
- Must start with a letter, followed by letters, digits, or underscores
29
-
- Max length: 40 characters
30
-
-**No hyphens** — use underscores instead
31
-
- Reserved words (cannot be used as IDs): `env`, `params`, `args`, `stdout`, `stderr`, `output`, `outputs`
Capture stdout **content** to a named variable with `output:`, reference with `${VAR}`. For JSON output, extract fields with `${VAR.key}`.
82
47
83
48
### Step reference properties (`${step_id.XXX}`)
84
49
85
-
Steps with an `id` expose three properties to downstream steps:
86
-
87
50
| Reference | Value |
88
51
|-----------|-------|
89
52
| `${step_id.stdout}` | **File path** to the step's stdout log |
90
53
| `${step_id.stderr}` | **File path** to the step's stderr log |
91
54
| `${step_id.exit_code}` | Exit code as a string |
92
55
93
-
**Important:** `${step_id.stdout}` returns the **file path**, not the content. Use `output:` to capture **content** into a variable.
56
+
**Important:** `${step_id.stdout}` returns the **file path**, not the content. Use `output:` to capture **content**. Slicing is supported: `${step_id.stdout:start:length}`.
94
57
95
-
Slicing syntax is supported: `${step_id.stdout:start:length}`
Override params at runtime: `dagu enqueue my-dag -- env=staging region=eu-west-1`
101
+
148
102
## Lifecycle Hooks
149
103
150
104
```yaml
@@ -188,7 +142,7 @@ steps:
188
142
189
143
## Dynamic Fan-Out with `parallel:`
190
144
191
-
Use `parallel:` to iterate over dynamic output from a previous step. Each item gets its own sub-DAG run with retry, timeout, and UI visibility. Requires `call:` (see pitfall #20). Do NOT use bash `for` loops over output variables (see pitfall #23).
145
+
Use `parallel:` to iterate over dynamic output from a previous step. Each item gets its own sub-DAG run with retry, timeout, and UI visibility. Requires `call:` (see pitfalls). Do NOT use bash `for` loops over output variables.
192
146
193
147
```yaml
194
148
type: graph
@@ -240,76 +194,27 @@ steps:
240
194
command: echo "handling error"
241
195
```
242
196
243
-
## Finding DAG Files
244
-
245
-
Run `dagu config` to discover where DAGs and other files are stored on the local system. The `DAGs directory` line shows where DAG YAML files should be created and read from.
Run `dagu schema <dag|config> [path]` to look up field definitions, types, defaults, and allowed values. Use dot-separated paths to drill into nested fields (e.g. `dagu schema dag steps.container`).
254
-
255
-
```bash
256
-
dagu schema dag # All DAG root-level fields
257
-
dagu schema dag steps # Step fields
258
-
dagu schema dag steps.container # Container config
259
-
dagu schema dag steps.retry_policy # Retry policy fields
260
-
dagu schema dag steps.agent # Agent step config
261
-
dagu schema dag handler_on # Lifecycle hooks
262
-
dagu schema dag defaults # Default step config
263
-
dagu schema config # All config fields
264
-
dagu schema config auth # Auth config
265
-
```
266
-
267
-
## Checking Run Status
268
-
269
-
For agent-triggered execution, prefer `dagu enqueue` over `dagu start`. Do not check whether the DAG is already running or queued before enqueueing unless the user explicitly asks for that check or requests singleton behavior.
270
-
271
-
After enqueueing or starting a DAG, use `dagu status` to inspect the result. The output is a tree showing each step's status, command, stdout/stderr content, and errors.
197
+
## CLI Quick Reference
272
198
273
199
```bash
274
-
dagu status my-dag # Latest run
275
-
dagu status --run-id=<id> my-dag # Specific run
276
-
dagu status --run-id=<id> --sub-run-id=<id> my-dag # Sub-DAG run
0 commit comments