Agent Playground
Graph shapes
The shapes a flow can take, with a small example of each: a straight line, branches, loops, loops inside loops, parallel lanes, agents working together, and how paths join again.
A flow doesn't have to be a straight line. Arrows can split it, bring it back together, and send it round again. This page shows each shape with a small example you can draw in a few minutes. The diagrams are drawn like the builder's canvas: they read top to bottom, the word on an arrow is the exit it leaves from, and a dashed arrow going back up is a loop.
A straight line
The simplest flow: each step runs after the one before.
If any step fails, the run ends there as failed, because its Failed exit has no arrow. That's often what you want.
Branches
A branch sends the run one of two (or more) ways. There are three kinds.
On pass or fail. Draw an arrow from each exit of the same step.
On a condition. A Decide block asks a yes or no question with a command, and the run goes on either way.
On an AI choice. An Ask AI block set to Decision gets one exit per choice.
Tip
Name your Output blocks for the ending they mean ("Shipped", "Not posted", "Ignored"). A run's ending then tells you what happened without opening it.
Loops
A loop is an arrow back to an earlier step. The classic is "try, check, fix, check again":
The loop ends when a step takes another exit (the tests pass) or a limit stops it. Every trip back counts as one loop, so with Loops set to 5 the run tries at most five fixes.
A retry with a pause puts a Wait in the loop, so a busy website gets a moment:
A loop with a way out. A step in the loop can have its own exit that leaves it. In the bug reproduction recipe, the step that writes the next test fails when it has run out of ideas, and that exit goes to "Ask for more detail" instead of round again.
Loops inside loops
A loop can sit inside another loop. In this flow the inner loop retries a flaky download, and the outer loop rewrites the analysis until it runs:
Both loops count toward the same Loops limit, so set it for the total number of trips you'll allow.
Parallel lanes
Try in parallel copies the sandbox into 2 to 10 lanes. Each lane has its own copy of the files, so the lanes can't break each other's work. On each step after it, set Run in to its lane.
A lane can be more than one step: draw a chain of steps that all run in lane A. A lane that fails just drops out of the contest.
Use lanes when you'd otherwise try ideas one after another: three prompts, three upgrade plans, three ways to research a question. They finish in the time of the slowest one, not the sum.
Agents working together
Agents together is the other way to do things at once. Its members share one sandbox and its files, instead of each getting a copy.
| Notes | Try in parallel | Agents together |
|---|---|---|
| Files | Each lane has its own copy | Shared by all members |
| How many | 2 to 10 lanes | 2 to 6 members |
| Ends with | Keep the best picks one lane | All are done, or the first is done |
| Good for | Competing ideas | Splitting one job into parts |
Joins
When paths come back together, the step they meet at runs once, after the paths before it are finished.
- Lanes join at Keep the best. Draw every lane's last step to the same Keep the best block. It waits for the lanes, keeps the passing lane with the best number as the main sandbox, and deletes the rest.
- Agents join when the group finishes. With all are done, when every member passes. With the first is done, as soon as one passes; the others are stopped.
- Branches join at a shared step. Two branches can lead to the same next step, like the "Restart" and "Leave it running" paths that both go on to "Write the summary" in the alert recipe. Use Either way on an arrow when the next step should run whatever happened.
What isn't possible yet
- A flow inside a flow. You can't use one saved flow as a single block in another. For now, build the shared steps into each flow. Duplicate on the Agent Playground page copies a whole flow to start from.
- Lanes inside a loop. A Try in parallel block can't run again on a later trip round a loop. Put the loop before the lanes or after Keep the best, or run the whole flow again.
- Combining lanes. Lanes can't be merged into each other: Keep the best keeps one. If you need parts of several lanes, have each lane print the number that matters, keep the best lane, and run a step after it that redoes the part you need.
Size limits
A flow can have up to 40 steps and 80 arrows. Each step can write up to 20 files (256 KB in total) before it runs, and a single command can run for up to 10 minutes. See Limits and safety for the limits on a whole run.