n8n-nodes-stateful-loop
v1.1.9
Published
Stateful Loop Node for n8n — maintain state across iterations.
Readme
n8n-nodes-stateful-loop
Author: OXSR
Icon: fa:repeat
Stateful Loop Node for n8n that lets you iterate over incoming items while preserving state (variables, counters, accumulators) between iterations.
Features
- Automatic iteration counter.
- Optional result storage per iteration (
vars.results). - Custom user variables via JSON initializer.
- Flexible JavaScript exit condition.
- Summary output with total iterations and final state.
Usage
- Add the Stateful Loop node to your workflow.
- Configure:
- Max Iterations — safety cap.
- Variable Initializer (JSON) — starting state, e.g.
{"sum":0,"products":[]}. - Exit Condition — JS expression, e.g.
totalSinStock >= 5.
- Wire downstream nodes to consume the final summary.
Development
npm install
npm run buildPublish to npm or load locally in n8n via the Community Nodes feature.
