Skip to content

For Loop Close (Deprecated)

Closes a deprecated for-loop construct. It decrements the loop counter and re-invokes the enclosed subgraph while the remaining count is greater than zero, passing through any auxiliary values each iteration. Use this only for legacy graphs; prefer the newer Loop Open/Close nodes.
Preview

Usage

Pair this node with For Loop Open (Deprecated). Connect For Loop Open’s flow_control output to this node’s flow_control input. Provide any values you want to persist across iterations via the optional initial_value inputs. The node internally decrements the counter and continues looping until the remaining value is no longer greater than zero, then returns the final carried values.

Inputs

FieldRequiredTypeDescriptionExample
flow_controlTrueFLOW_CONTROLLoop control link from For Loop Open (Deprecated). Drives the loop’s lifecycle.Link from For Loop Open (Deprecated) -> flow_control
initial_value1FalseWILDCARDFirst value to carry through and update each iteration.Text, Image, Dict, or any data
initial_value2FalseWILDCARDSecond value to carry through and update each iteration.Counter, List, or any data
initial_value3FalseWILDCARDThird value to carry through and update each iteration.Accumulated result object
initial_value4FalseWILDCARDFourth value to carry through and update each iteration.Auxiliary state

Outputs

FieldTypeDescriptionExample
value1*Final value of the first carried data after the loop completes.Final text/image/result object
value2*Final value of the second carried data after the loop completes.Final counter/list/state
value3*Final value of the third carried data after the loop completes.Final accumulated result
value4*Final value of the fourth carried data after the loop completes.Final auxiliary state

Important Notes

  • This node is deprecated. Prefer using Loop Open and Loop Close for new workflows.
  • Works only when connected to For Loop Open (Deprecated) via the flow_control input.
  • The loop counter is decremented each iteration and the loop continues while remaining > 0.
  • Optional inputs initial_value1–initial_value4 are carried across iterations and returned as outputs.
  • On internal errors, outputs may return as None.
  • Requires supporting arithmetic and comparison nodes (integer subtraction and condition). If those nodes are missing, the loop will fail to expand.

Troubleshooting

  • Loop never runs or exits immediately: Ensure the remaining value provided by For Loop Open is greater than 0.
  • Graph doesn’t expand or errors about missing operations: Make sure integer math and condition nodes are available and correctly installed.
  • Outputs are None: This typically indicates an internal error during expansion; check the node connections and types of initial_value inputs.
  • No updates to carried values: Verify you’ve wired the outputs of the loop body back into the corresponding initial_value inputs on For Loop Close.