JSON Loop Close¶
Completes and advances a JSON Loop created by JSON Loop Open. It evaluates a condition to decide whether to continue iterating or finish, and passes along final auxiliary values when the loop ends. This node emits a FINISHED? flag that is True only when the loop has completed or has been terminated by the condition.

Usage¶
Use this node in tandem with JSON Loop Open to iterate over a JSON array. Connect the LOOP output from JSON Loop Open to this node. Optionally provide auxiliary inputs to carry state across iterations. Set the condition to control whether the loop should continue; when the loop is done, FINISHED? will be True and the final auxiliary values are output.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| LOOP | True | any | The loop state dictionary from JSON Loop Open. Required to track index, finish state, and control iteration. | {'id': 1, 'index': 0, 'finished': False, 'total_items': 3, 'last_id': 42} |
| condition | True | STRING | Expression evaluated each step to decide whether to continue. If it evaluates to False or errors, the loop finalizes and FINISHED? becomes True. | index < total_items - 1 |
| aux | False | any | Primary auxiliary data carried through each iteration and returned when the loop finishes. | {'accumulator': []} |
| aux2 | False | any | Secondary auxiliary data slot to persist state across iterations. | 10 |
| aux3 | False | any | Tertiary auxiliary data slot to persist state across iterations. | partial_result |
| aux4 | False | any | Quaternary auxiliary data slot to persist state across iterations. | {'seen_ids': [1, 2]} |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| FINISHED? | BOOLEAN | True when the loop has completed or has been terminated by the condition. Otherwise the loop continues. | True |
| aux | any | Final value of the primary auxiliary data after the loop completes. | {'accumulator': ['a', 'b', 'c']} |
| aux2 | any | Final value of the secondary auxiliary data after the loop completes. | 27 |
| aux3 | any | Final value of the tertiary auxiliary data after the loop completes. | done |
| aux4 | any | Final value of the quaternary auxiliary data after the loop completes. | {'seen_ids': [1, 2, 3]} |
Important Notes¶
- Condition behavior: The condition is a string expression evaluated against the loop state and provided inputs. If it evaluates to False or throws an error, the loop finalizes and FINISHED? outputs True.
- Required connection: LOOP must be connected from the JSON Loop Open node; otherwise the node cannot function.
- Aux persistence: Only auxiliary inputs that are wired into this node are preserved and returned when the loop finishes.
- Early termination: You can terminate the loop early by setting a condition that becomes False before all items are processed.
- Empty list handling: If the JSON array is empty, the loop finalizes immediately and FINISHED? is True.
Troubleshooting¶
- FINISHED? never becomes True: Verify that the condition can become False or that the input list has finite length. Ensure LOOP is properly connected from JSON Loop Open.
- Loop stops immediately: Check the condition string; if it evaluates to False at the first step or is invalid, the loop will finalize immediately.
- Aux outputs are None: Make sure aux, aux2, aux3, and aux4 are connected into this node during the loop. Unwired auxiliaries will not carry state.
- Condition errors: If the condition references variables that do not exist (e.g., misspelled 'index' or 'total_items'), it will be treated as False and finalize the loop. Use available loop variables from LOOP such as index and total_items.