Skip to content

Feat/automation loop node - #3080

Merged
ryanweiler92 merged 13 commits into
devfrom
feat/automation-loop-node
Oct 7, 2026
Merged

ryanweiler92 merged 13 commits into
devfrom
feat/automation-loop-node

Conversation

@ppatel9703

@ppatel9703 ppatel9703 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds the backend contract and execution lifecycle for bounded Automation loops. A loop owns a nested acyclic body graph, while Java controls iteration, limits, cancellation, routing, and run-history persistence. Existing node executors continue to run the work inside each iteration.

This PR also adds the data-extraction node used by file-processing workflows and hardens runtime scope-path handling for loop inputs.

Changes Made

  • Added control.loop with three bounded modes:
    • For each — iterate over a list, optionally in batches.
    • Repeat — run a fixed number of times.
    • While — repeat while a validated condition remains true.
  • Added loop-body validation for:
    • one executable entry path;
    • unique node IDs and output variables;
    • bounded iterations, batch sizes, and body size;
    • no nested loops or agent input waits in phase 1.
  • Added per-iteration scope values, including the current item/batch, index, iteration number, and prior body outputs.
  • Persisted loop and inner-node results so the UI can show each iteration and step independently in run history.
  • Added data.extract for JSON/XML values with configurable paths and missing/null fallbacks.
  • Preserved complete storage file paths for downstream loop processing.
  • Hardened runtime placeholder parsing, including root bracket paths such as $["labName"] and keys containing dots.
  • Corrected generated Automation source so the runtime module is imported exactly once after the package refactor.
  • Added focused Java and Python regression coverage for catalog definitions, validation, rendering, execution, result persistence, and path resolution.

Deferred browser/Playwright and general data-transformation nodes are intentionally not included in the final scope.

How to Test

  1. Rebuild and restart the backend.
  2. Create an Automation with a list-producing node followed by a loop.
  3. Configure the loop as For each, Repeat, or While, then add one or more ordinary nodes to its body.
  4. Reference the loop item/index from a body node and run the Automation.
  5. Confirm the loop is bounded and that each iteration records its inner-node results.
  6. For extraction coverage, process JSON with a path such as labName or $["labName"] and verify the same value is returned.
  7. Verify invalid loop bodies, excessive bounds, nested loops, and agent waits inside loops are rejected.

Verification

  • Focused Python runtime suite: 7 tests passed.
  • Live local file-processing Automation: passed, including 8 loop iterations and nested results.
  • Root-bracket extraction ($["labName"]): passed after a backend rebuild.
  • Java regression tests were added; Maven was not run locally.

Notes

  • Phase 1 executes loop iterations sequentially and keeps the parent workflow graph acyclic.
  • Nested loops and agent input waits inside loop bodies remain intentionally unsupported.
  • The work stays within the Automation runtime, definition, execution, and scheduling integration areas.

@snyk-io

snyk-io Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ppatel9703
ppatel9703 marked this pull request as ready for review October 7, 2026 21:05
@ppatel9703
ppatel9703 requested a review from a team as a code owner October 7, 2026 21:05
@ryanweiler92
ryanweiler92 merged commit 7dbad54 into dev Oct 7, 2026
5 checks passed
@ryanweiler92
ryanweiler92 deleted the feat/automation-loop-node branch October 7, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants