Build your first AI workflow: lesson 6 of 10

Loops, and Why They Need a Limit

A loop is draft, check, revise. When a check fails, the step runs again and is told exactly what the check found. The loop always has a limit: after that, the workflow stops and flags the problem for you.

DraftThe checkFinishedTry again(once)Stop andflag it
Draft
A step makes a first draft, for example a short reply to a client.

What Makes a Good Loop

  1. 1Told what failedThe second try is given exactly what the check found, so it fixes that and nothing else.
  2. 2A limit on roundsOnce or twice, then stop. A step that cannot fix a problem in two tries rarely fixes it in ten.
  3. 3Flag it, never guessIf it still fails, you get the problem to look at, not a made-up fix that only looks finished.
  4. 4A check that says whyA loop needs a check that points at the problem. “Not good” gives the step nothing to fix; “the third figure is not in the report” does.

Put the Loop in Order

These are the five moves of a loop with a limit of one more try. Put them in the order they happen, then check.

  1. 1The step runs again, told what the check found
  2. 2If it still fails, the workflow stops and flags it for you
  3. 3The step writes its first draft
  4. 4The check looks at the new draft
  5. 5The check looks at the draft