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
Spun out from closed PR #1282 (3 features bundled — landing them one at a time). Depends on #1764 (workflow: node type) and #1763 (condition-evaluator improvements) landing first.
When loop_until is set, the executor re-runs the full DAG until the condition evaluates true, capped at max_iterations. Distinct from node-level loop: (which iterates a single prompt).
Why
The motivating case: "plan → implement → test → fix → retest until tests pass" as a workflow-level loop rather than as multi-level nested loop: nodes. Today this requires duplicating nodes, capped at compile time.
Whole-DAG re-run only — no partial-DAG retry, no per-node retry policy (those are different features)
Fresh artifact subdirectory per iteration so iterations don't pollute each other's $ARTIFACTS_DIR
No exponential backoff or delay between iterations for v1
Why this depends on the other two
feat(workflows): add workflow: node type for DAG composition #1764: loop_until is a natural fit on the parent workflow when the loop body delegates to a child via workflow:. Without workflow: you'd need everything inline, which is what the contributor's example workflows demonstrate (e.g., archon-compose-plan-implement-qa.yaml).
New fields on workflowBaseSchema: loop_until?: string, max_iterations?: number (default 5)
Outer iteration loop in executeDagWorkflow: after each DAG pass, evaluate loop_until against final node outputs. If false and iterations < max → emit workflow.iteration_started event, re-run the full DAG with a fresh scope (cleared node outputs). If condition met → exit. If max exhausted → emit warning, exit normally.
Cancel-token check at top of each iteration so a paused/cancelled workflow stops
Reference implementation
@Dev-Force already implemented this in PR #1282 — the outer iteration loop in executeDagWorkflow is the main reference. The archon-compose-plan-implement-qa.yaml example shows the API works but uses a node-level loop: for the implement-retry phase (intentional choice — only that phase retries, not the planner).
Acceptance
Tests: condition met on iteration 1 (single pass), condition met on iteration N, max_iterations exhausted, condition fail-closed on bad expression, cancel mid-iteration honored
Spun out from closed PR #1282 (3 features bundled — landing them one at a time). Depends on #1764 (
workflow:node type) and #1763 (condition-evaluator improvements) landing first.What
Add two top-level workflow fields:
When
loop_untilis set, the executor re-runs the full DAG until the condition evaluates true, capped atmax_iterations. Distinct from node-levelloop:(which iterates a single prompt).Why
The motivating case: "plan → implement → test → fix → retest until tests pass" as a workflow-level loop rather than as multi-level nested
loop:nodes. Today this requires duplicating nodes, capped at compile time.Scope boundary
loop:semantics (PR 🐛 [Bug]: can get list of projects #785 stays orthogonal)$ARTIFACTS_DIRWhy this depends on the other two
workflow:node type for DAG composition #1764:loop_untilis a natural fit on the parent workflow when the loop body delegates to a child viaworkflow:. Withoutworkflow:you'd need everything inline, which is what the contributor's example workflows demonstrate (e.g.,archon-compose-plan-implement-qa.yaml).loop_untiluses the same evaluator aswhen:. Numeric / boolean comparisons in iteration conditions read awkwardly without unquoted RHS support.Design
workflowBaseSchema:loop_until?: string,max_iterations?: number (default 5)executeDagWorkflow: after each DAG pass, evaluateloop_untilagainst final node outputs. If false and iterations < max → emitworkflow.iteration_startedevent, re-run the full DAG with a fresh scope (cleared node outputs). If condition met → exit. If max exhausted → emit warning, exit normally.workflow.iteration_started,workflow.iteration_completed,workflow.loop_max_iterations_reachedReference implementation
@Dev-Force already implemented this in PR #1282 — the outer iteration loop in
executeDagWorkflowis the main reference. Thearchon-compose-plan-implement-qa.yamlexample shows the API works but uses a node-levelloop:for the implement-retry phase (intentional choice — only that phase retries, not the planner).Acceptance
loop_untilat workflow level (different from Fix Issue #972 | Workflow Composition #1282'sloop:example so both patterns are demonstrated)Suggested PR title
feat(workflows): add workflow-level loop_until + max_iterations