Skip to content

Add collection-based For and ForReturn loop nodes - #189

Open
JPPhoto wants to merge 7 commits into
invoke-ai:mainfrom
JPPhoto:JPP/for-node-v7
Open

Add collection-based For and ForReturn loop nodes#189
JPPhoto wants to merge 7 commits into
invoke-ai:mainfrom
JPPhoto:JPP/for-node-v7

Conversation

@JPPhoto

@JPPhoto JPPhoto commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds bounded, collection-based For and ForReturn workflow nodes.

Highlights:

  • Adds sequential loop execution with loop-carried LoopState.
  • Supports empty collections, early termination, final output aggregation, cleanup, persistence, and resume.
  • Supports validated nested For loops and bounded Iterate/Collect bodies.
  • Adds explicit collection operations:
    • CollectionConcat
    • CollectionZip
    • CollectionCartesian
  • Adds durable direct loop_linkage edges between For and ForReturn.
  • Keeps connector paths as editor-only aliases that canonicalize to direct runtime linkage edges.
  • Adds backend and frontend graph validation for invalid, duplicate, escaped, cyclic, and mixed loop structures.
  • Adds loop output scopes for iteration and final outputs.
  • Adds contextual ForReturn discovery and auto-connection in the node picker.
  • Adds loop boundary visualization and connector deletion/reconnection handling.
  • Regenerates OpenAPI and frontend schemas.
  • Adds user and architecture documentation.
  • Reuses the existing happy-dom setup without adding browser-test dependencies.

Related Issues / Discussions

QA Instructions

Create some workflows with nested For loops, For loops containing bounded Iterate/Collect bodies. This is what an example For workflow might look like:
For Loop State Example

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@JPPhoto JPPhoto closed this Aug 31, 2026
@JPPhoto
JPPhoto deleted the JPP/for-node-v7 branch August 31, 2026 11:31
@JPPhoto
JPPhoto restored the JPP/for-node-v7 branch August 31, 2026 11:33
@JPPhoto
JPPhoto deleted the JPP/for-node-v7 branch August 31, 2026 11:34
@JPPhoto
JPPhoto restored the JPP/for-node-v7 branch August 31, 2026 11:35
@JPPhoto JPPhoto reopened this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 7.0 Theme: Tabbed Layout UI

Development

Successfully merging this pull request may close these issues.

3 participants