Commit df7514a
feat: Loop node implementation (#247)
* docs: Add loop node design document
Design for a new loop composite node that iterates until a break
condition is met or max iterations is reached. Includes:
- Do-while execution style
- Parameter flow between iterations
- Lineage tracking via separate branch logs per iteration
- Argo compatibility via recursive templates
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* docs: Update loop node design - branch must always be Pipeline
Clarify that loop node branch parameter must always be a Pipeline,
consistent with other composite nodes (parallel, map, conditional).
Update SDK examples to wrap tasks in Pipeline objects.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* docs: added plan for loop node
* feat: add LOOP_PLACEHOLDER constant
Add loop placeholder constant following MAP_PLACEHOLDER pattern
for iteration index replacement in loop node names
* feat: refactor placeholder resolution for map and loop
- Rename _resolve_map_placeholders to _resolve_iter_placeholders
- Add support for LOOP_PLACEHOLDER resolution
- Handle nested map and loop placeholders correctly
- Keep old method for backward compatibility
Co-Authored-By: Claude Sonnet 4 <[email protected]>
* feat: add basic LoopNode class with placeholder support
- Create LoopNode class following composite node patterns
- Use LOOP_PLACEHOLDER for branch name generation
- Add validation for break_on and index_as parameters
- Implement _get_iteration_branch_name using refactored placeholder resolution
Co-Authored-By: Claude Sonnet 4 <[email protected]>
* feat: add loop node parameter and branch log management
- Add get_break_condition_value() method with proper validation
- Add _create_iteration_branch_log() using placeholder resolution
- Add _build_iteration_iter_variable() for iteration context
- Proper error handling for missing/invalid parameters
- Add comprehensive tests for all new methods
Co-Authored-By: Claude Sonnet 4 <[email protected]>
* feat: implement LoopNode fan_out method
- Create branch logs for current iteration
- Copy parameters from parent (iteration 0) or previous iteration
- Use proper placeholder resolution for branch names
- Support both initial and subsequent iterations
Co-Authored-By: Claude Sonnet 4 <[email protected]>
* feat: implement LoopNode fan_in method
- Check break condition and max iterations correctly
- Roll back parameters to parent on loop exit
- Set final step status based on branch execution
- Extract current iteration from iter_variable properly
Co-Authored-By: Claude Sonnet 4 <[email protected]>
* feat: loop node, missing argo implementation
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent 3a6bcb0 commit df7514a
File tree
21 files changed
+4047
-55
lines changed- docs
- advanced-patterns
- compare
- plans
- examples/10-loop
- extensions/nodes
- runnable
- tests
- extensions/nodes
- runnable
21 files changed
+4047
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments