Until
A ↻ Until node re-enters a subgraph a limited number of times, then emits on exhausted.
It is the sanctioned way to retry a stage. Free cycles (fail → fix → back) stay refused by the DAG runner.
Why it exists
Section titled “Why it exists”Judge and agent graphs often need “try again, then give up.” Without Until you’d either abort on the first miss or invent an illegal cycle. Until keeps the graph a DAG for scheduling and still lets a body run again.
How it works
Section titled “How it works”- Inbound text arrives on Until (same join rules as other single-in nodes).
- While the iteration count is below max (default 3, hard cap 8), Until emits on
out:reenter. - Reenter edges carry
role: "reenter"(orsourceHandle: "out:reenter"). Topo / predecessor scheduling ignores those edges so the graph stays a DAG. - On re-entry, the executor resets the loop body (reenter targets and everything reachable from them via structural edges, including Until) and injects the text into the reenter targets.
- When the count is exhausted, Until emits on
out:exhaustedinstead.
| Handle | Role |
|---|---|
out:reenter | Try the body again (counted) |
out:exhausted | Max iterations reached. Continue the exit arm |
Guards
Section titled “Guards”Pair Until with a spend ceiling and/or a ‡ circuit breaker. Graph lint hints when an Until graph has neither.
threadle run until-reenterPatterns
Section titled “Patterns”Stage retry. Judge fail → Until → reenter implement / convert → review again → Until exhausted → human / abort.
Agent-free loop. Prompt → convert → Until → reenter convert → exhausted output (the bundled example).
Related
Section titled “Related”- Judge. Route by match. Compose with Until on the fail arm
- Circuit breakers. Fuse on one wire
- Errors & retries. Per-node retry vs counted re-entry
- Examples.
until-reenter