Agent Playground
Tutorial 7: Edit a flow as text
Open your flow as JSON, change several things at once, copy it to share with a teammate, and import someone else's flow. No coding experience needed.
Every flow is also a short text document. You don't need it to use the Playground, but it's handy for three things: changing many settings at once, keeping a copy of a flow, and sharing a flow with someone else. In this tutorial you'll change your website check from Tutorial 1 as text, then copy it and import it as a new flow.
Time: about 10 minutes. Plan: Free.
1. Open the JSON
Open your Check my website flow and choose JSON in the toolbar (on a phone or narrow screen, it's under More). A panel opens with the flow as text:
{
"$schema": "https://api.quietrobot.ai/api/v1/flows/schema",
"name": "Check my website",
"graph": {
"template": "base",
"start": "fetch",
"nodes": [
{ "id": "fetch", "label": "Fetch my homepage", "kind": "run", "cmd": "curl -sSfL -o home.html https://example.com && echo \"Got $(wc -c < home.html) bytes\"" },
{ "id": "check", "label": "Is the page right?", "kind": "branch", "cmd": "grep -q \"Example Domain\" home.html" },
{ "id": "good", "label": "All good", "kind": "end" },
{ "id": "bad", "label": "Needs a look", "kind": "end" }
],
"edges": [
{ "from": "fetch", "to": "check", "when": "pass" },
{ "from": "check", "to": "good", "when": "pass" },
{ "from": "check", "to": "bad", "when": "fail" }
]
},
"guards": { "maxLoops": 1, "timeSec": 60, "budgetUsd": 0.05 }
}Your step ids may look different (the builder makes them up for steps you add), and the panel also lists where each box sits on the canvas, under layout. It reads like this:
nodesare the boxes. Each has anid, thelabelyou see on the canvas, itskind(runis a command,branchis a Decide step,endis an Output), and its settings, likecmdfor the command.edgesare the arrows, from one step'sidto another's."when": "pass"means the Passed or Yes exit, and"fail"means Failed or No.guardsare the run's limits: loops, time in seconds and spend in dollars.
2. Change something
Let's make the check stricter and give it a little more time.
- In the text, find the
cmdof thebranchstep and change the phrase between the quotes to another phrase from your homepage. - Find
"timeSec": 60and change it to120.
About half a second after you stop typing, the change goes onto the canvas and saves, like any other change. Select Is the page right? on the canvas and you'll see the new condition. Undo works too.
If you make a typo, like deleting a comma, the note under the editor says Not applied and what's wrong, and the canvas keeps the last good version. Go to line takes you to the problem. Undo my edits here puts the text back. Nothing you type in the panel can break the flow.
3. Read the checks
Under the editor, the flow is checked the same way Run checks it, and anything it finds is listed in three groups:
- Before it can run: problems that would stop a run, like a step with nothing to do or an arrow to a step that doesn't exist.
- Will wait for a person: steps that will pause for an approval.
- Left out: text that isn't part of a flow, usually a typo, like
comandforcmd.
Each one has Go to, to jump to it in the text, and Show on canvas, to select its step.
Not sure what a step can have? Choose Fields: it lists every setting for every kind of step, with a line on what each one does.
4. Copy a flow, and import one
To share a flow with a teammate, or keep a copy before a big change:
- Choose Copy JSON (or Download .json to save it as a file).
- Send it to your teammate, or keep it somewhere safe.
To use a flow someone sent you:
- Choose New flow in Agent Playground, then JSON in the toolbar.
- Choose Import JSON, and paste the text or choose the
.jsonfile. - You'll be asked first, because importing replaces the flow's steps, arrows and limits. Confirm, and the flow appears on the canvas.
An import can be undone like any other change. To keep a version you can return to any time, use History in the toolbar.
Tip
Imported flows follow your organization's rules, not the sender's. Before you run a flow from someone else, read its commands, just as you would a script from the internet.
What you learned
- Every flow is a JSON document: nodes (the boxes), edges (the arrows) and guards (the limits).
- Edits in the JSON panel show on the canvas as you type, and mistakes never break the flow.
- Copy JSON, Download .json and Import JSON let you keep and share flows.
Next
In Tutorial 8, you'll use this same document from code, and let an AI app like Claude build and run flows for you.