Skip to content

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.


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.


  1. Inbound text arrives on Until (same join rules as other single-in nodes).
  2. While the iteration count is below max (default 3, hard cap 8), Until emits on out:reenter.
  3. Reenter edges carry role: "reenter" (or sourceHandle: "out:reenter"). Topo / predecessor scheduling ignores those edges so the graph stays a DAG.
  4. 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.
  5. When the count is exhausted, Until emits on out:exhausted instead.
HandleRole
out:reenterTry the body again (counted)
out:exhaustedMax iterations reached. Continue the exit arm

Pair Until with a spend ceiling and/or a ‡ circuit breaker. Graph lint hints when an Until graph has neither.

Terminal window
threadle run until-reenter

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).