Problem
- Workflow authors cannot repeat a multi-node DAG fragment inside one loop iteration;
loop: only repeats a single prompt today.
- This affects Archon workflow authors using DAG YAML, especially build/test/fix, plan/implement/validate, and adversarial multi-role loops.
- It comes up whenever one iteration needs multiple nodes with explicit dependencies; current workarounds are a giant loop prompt [!] or extracting a child workflow.
Proposed Solution
Allow inline composite loops: a loop body that can contain a small sub-graph (nodes) executed once per iteration until the loop exit condition passes.
Related: #972 currently prefers workflow composition over nesting. This request is specifically for inline composite loops when extraction is too heavy or hurts readability.
User Flow
Before (current)
Author wants: plan -> implement -> validate -> repeat until done
workflow nodes
-> single loop node
-> [!] must collapse all three phases into one prompt
OR
-> [!] extract a separate child workflow just to get iteration over multiple steps
After (proposed)
workflow nodes
-> composite loop
-> [+] iteration body runs plan -> implement -> validate sub-graph
-> [+] loop exits when until/until_bash condition passes
-> [+] parent workflow sees one loop node output
Alternatives Considered
| Alternative |
Pros |
Cons |
Why not chosen |
| Single prompt loop |
Already supported |
Blurs phases, weaker observability, harder validation |
Too much logic in one prompt |
| Child workflow + workflow-level loop |
Reuses existing workflow boundary |
Heavier authoring, extra indirection for small local loops |
Good fallback, but not ergonomic inline |
| Manual unrolling |
Simple runtime model |
Repetitive, fixed retry count, hard to maintain |
Not scalable |
Scope
- Package(s) likely affected:
workflows, possibly server and web for validation/editor support
- Breaking change? (
No)
- Database changes needed? (
No)
- New external dependencies? (
No)
Security Considerations
- New permissions/capabilities? (
No)
- New external network calls? (
No)
- Secrets/tokens handling? (
No)
- If any
Yes, describe:
Definition of Done
Problem
loop:only repeats a single prompt today.Proposed Solution
Allow inline composite loops: a loop body that can contain a small sub-graph (
nodes) executed once per iteration until the loop exit condition passes.Related: #972 currently prefers workflow composition over nesting. This request is specifically for inline composite loops when extraction is too heavy or hurts readability.
User Flow
Before (current)
After (proposed)
Alternatives Considered
Scope
workflows, possiblyserverandwebfor validation/editor supportNo)No)No)Security Considerations
No)No)No)Yes, describe:Definition of Done