Skip to content

Decide and Repeat: branching and auto-revision

Route each item by a condition, or send it back through earlier steps until it passes — bounded, so a loop around a paid step can never spend forever.

In this article (4)

Two cards give a flow judgement per item, which is what separates "generate two hundred things" from "generate two hundred things and only pass on the good ones".

Decide — send each item down a path

Set conditions in plain terms — contains, equals, ≥, <, is empty — against an earlier step's output or an item's own fields. The first matching route wins, and there is always an otherwise route, so no item is ever stranded.

If the QA score is under 70 → revise. Otherwise → publish.

Items that take a route the other branch does not cover simply do not run that branch's steps — you are not charged for a path an item did not take.

Repeat — try again until it passes

Repeat sends an item back through earlier steps while a condition holds: while the score is under 80, go back to Generate, feeding in the reviewer's notes.

The guardrails are the point:

  • At most 5 tries (default 3). You cannot configure an unbounded loop around a paid generation step.
  • After the last attempt the item continues with its best attempt and is flagged Needs review in results — never quietly passed off as a success.
  • Each attempt is a real, separately-costed execution, visible per item in the run monitor, so a loop's cost is never a mystery.

See the routing before you spend

The Data tab shows which route each item will take for $0. If everything is heading down otherwise, the condition is not matching what you think — much better to learn that now. After a run, Decide and Repeat cards show a count chip per route, so you can see at a glance how the batch split.

A working example

The Ad + QA loop template is all of this in one flow: generate an ad, have a Claude vision reviewer score it, regenerate with the reviewer's notes while the score is under 80, up to three times. Two things it teaches by doing:

  • Pick a Gemini pool for the image step and a Claude (Anthropic) pool for QA — the reviewer has to be able to see the image.
  • Items that never pass arrive as their best attempt with Needs review on them, which is what you want: flagged, not hidden, not endless.