loop: repeats a single node until its own typed output says to stop. It is a do-while loop: the node runs once, then pflow evaluates the condition.
while: ${node.more}continues while the value is truthy.until: ${node.done}continues while the value is falsy.
Carried State
Usecarry: when the next iteration needs state produced by the previous one. The node’s inputs: are the round-1 seed. On round 2 and later, carry: overrides only the carried keys.
carry: value must reference this loop node’s latest output. A missing or typoed carried output is a runtime error even when template resolution is permissive — the error names the loop node and its available outputs.
A literal coalesce fallback breaks that guarantee, so avoid it in carry:. With carry: { contenders: ${run-rounds.survivors ?? []} }, the [] always resolves, so a round where the body omits survivors silently re-seeds contenders to [] instead of erroring. Validation warns when a carry value uses a literal fallback. A round-1 default belongs in inputs:, not in a carry fallback.
For shell and llm nodes, carried keys are effective only when referenced in command, prompt, or system text. Code and workflow nodes consume inputs: directly.
Caps And Inspection
max_iterations is optional and defaults to the visit guard. Hitting the cap is not a failure; pflow stamps loop_stopped: "max_iterations" on the loop output. A condition stop stamps loop_stopped: "condition".
--only <loop-node> runs exactly one iteration with round-1 seed inputs. It does not reproduce a mid-loop carried state.
