From 5d6504a92cb8c606afade89cccbcaba3684fb045 Mon Sep 17 00:00:00 2001 From: Yota Hamada Date: Sun, 1 Nov 2026 00:13:42 +0900 Subject: [PATCH] Fix step exit code references in examples The graceful-degradation examples read a step's exit code from an environment variable named after the step ID. Dagu sets no such variable, so the precondition never matched and the fallback step was always skipped. Use the supported ${.exit_code} reference. Also state that a dag.run child does not go through its queue, so the queue's max_concurrency does not limit it. Refs dagucloud/dagu#3033 --- writing-workflows/continue-on.md | 4 ++-- writing-workflows/control-flow.md | 2 +- writing-workflows/queues.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/writing-workflows/continue-on.md b/writing-workflows/continue-on.md index 5d667c3..d6fb1fd 100644 --- a/writing-workflows/continue-on.md +++ b/writing-workflows/continue-on.md @@ -212,7 +212,7 @@ steps: - id: fallback_method run: echo "Processing with fallback settings" preconditions: - - condition: "${env.TRY_OPTIMAL_METHOD_EXIT_CODE}" + - condition: "${try_optimal_method.exit_code}" expected: "re:[1-9][0-9]*" # Only run if previous failed depends: try_optimal_method ``` @@ -345,7 +345,7 @@ steps: - id: check_secondary run: curl -f https://secondary.example.com/health preconditions: - - condition: "${env.CHECK_PRIMARY_EXIT_CODE}" + - condition: "${check_primary.exit_code}" expected: "re:[1-9][0-9]*" # Only if primary failed depends: check_primary ``` diff --git a/writing-workflows/control-flow.md b/writing-workflows/control-flow.md index f807921..f04e9e8 100644 --- a/writing-workflows/control-flow.md +++ b/writing-workflows/control-flow.md @@ -1013,7 +1013,7 @@ steps: - id: simple_method run: echo "Processing with simple settings" preconditions: - - condition: "${env.TRY_ADVANCED_METHOD_EXIT_CODE}" + - condition: "${try_advanced_method.exit_code}" expected: "re:[1-9][0-9]*" depends: try_advanced_method diff --git a/writing-workflows/queues.md b/writing-workflows/queues.md index 45994c3..eda47a2 100644 --- a/writing-workflows/queues.md +++ b/writing-workflows/queues.md @@ -67,4 +67,4 @@ steps: `with.queue` overrides the child DAG's queue for that enqueued run. If it is omitted, Dagu uses the child DAG's top-level `queue`, the base-config default, or the child's local queue. The parent step succeeds after the child run is persisted and added to the queue. -Use `action: dag.run` instead when the parent workflow must wait for the child DAG result before continuing. +Use `action: dag.run` instead when the parent workflow must wait for the child DAG result before continuing. A `dag.run` child starts directly rather than through its queue, so the queue's `max_concurrency` does not limit it.