Add optional if expression to each.do steps - #6214
Conversation
📝 WalkthroughWalkthroughReplaces the shorthand ChangesNamed step model for each.do
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ab7180c to
2105a0e
Compare
Lets a step inside an `each` action run conditionally based on a CEL expression evaluated against `item` and prior step `outputs`.
2105a0e to
95f4a12
Compare
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
Lets a step inside an
eachaction run conditionally based on a CEL expression evaluated againstitemand prior stepoutputs.Note
Medium Risk
The
each.doYAML/JSON shape change breaks existing flow definitions until migrated; runtime behavior for skipped steps (preserving prior output) is new and should be validated by consumers.Overview
Breaking change:
each.dono longer uses single-key maps (normalize: { call: ... }). Steps are now objects withname,action, and an optionalifCEL expression.Each iteration can skip steps when
ifis false; skipped steps do not updateoutputsor the iteration’s last result.ifmust evaluate to a boolean (truthy non-bools raise at runtime).ifis only valid oneach.dosteps, not on top-level methoddoactions (extra fields are rejected).Runtime
EachActionevaluatesifagainstitemand per-iterationoutputs, and introducesFlowAtomicActionDefinitionso nested steps cannot nest anothereach. Step name uniqueness is enforced via shared_validate_step_list.Reviewed by Cursor Bugbot for commit 95f4a12. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
ifclauses.Changes