Guide · · 7 min read
Build and run flows from your AI assistant: the Playground API and MCP tools
Ask Claude, ChatGPT, Cursor or VS Code in plain words to build, check and run an Agent Playground flow, and it shows up on your canvas for you to review. Or do the same from code with a few curl commands. Either way, your limits, rules and approvals stay in charge.

Agent Playground is an agent orchestration layer you can see. You drag steps onto a canvas, connect them with arrows, and watch a run move through them. But you don't have to start with the mouse.
You can also ask an AI assistant you already use to build and run flows for you, or send a few short commands from your own code. Either way it's the same flow: it opens on your canvas, runs under the same limits, and a risky step still waits for a person.
This guide covers both, plus the JSON editor that ties them together. If you'd rather follow along step by step, Tutorial 8 takes about 15 minutes on the Free plan.
Part 1: Ask your AI assistant
The Playground works with apps that support MCP, an open standard for connecting AI apps to tools. Claude, ChatGPT, Cursor and VS Code all support it.
Connect once
In your AI app, add a connector (some apps call it a custom connector or an MCP server) with this address, then sign in with your Quiet Robot account when it asks:
https://api.quietrobot.ai/mcp
The Playground tools come with it. There's nothing else to turn on. The MCP server page has the steps for each app.
Then ask in plain words
Here are four things you can ask, and what happens when you do.
"Show me the Playground recipes, then save Fix until tests pass as a flow and run it." The app lists the ready-made recipes, saves the one you named as a new flow and runs it on real sandboxes. Then it tells you how the run went: its status, loops, cost and what each step did.
"Build a flow that clones github.com/you/app, runs the tests, lets an agent fix failures and asks me before it pushes. Check it, then save it." The app writes the flow, then checks it before saving anything. The check says what's wrong and where, whether your plan can run that many sandboxes at once, and which steps your rules will hold for a person. Once it's clean, the app saves it. Open Agent Playground and the flow is on your canvas, ready for you to read before you run it.
"Why won't my flow Nightly evals run?" The app checks the flow you named and tells you why, such as a step with no command, a missing Claude key or more parallel lanes than your plan allows.
"Lower the budget on Scraper to 10 cents and save it." The app changes the flow's spend limit and saves it. Open it in the builder and the new limit is there.
The app works with the same flow document as the builder, so a flow it saves opens on the canvas, and a flow you drew can be changed by the app. The full list of tools, from list_recipes to cancel_run, is on the MCP tools page.
What stays in your hands
An AI app gets no more power than you give it. The rules live outside the app and outside the agent:
- Limits. Every run stops at its most loops, longest time and most money. That's checked on our side, whatever the app asks for.
- Approvals. A step that your rules or the flow hold shows as
waiting. The app can see that it's waiting, but it can't approve it. A person decides, from the Approvals page in the dashboard or from the approval email. The run's time limit keeps counting while it waits, so give a flow with an approval enough time for someone to answer. - Your plan. A flow that needs more sandboxes at once than your plan runs is refused before it starts, and the check tells the app so first.
- Your Claude key. AI steps use the key you saved under Policies → Secrets as
ANTHROPIC_API_KEY. The app never sees it, and neither does the sandbox. (Why that matters.) - What it can touch. If you just want the app to look, connect it with a read-only key. It can list, read and check flows and runs, but not save or start them.
Part 2: From your own code
The Flows API lets a system you already run start a flow, like the end of a deploy or a nightly job. It's plain HTTP, so curl is enough.
Get a key
In the dashboard, open API keys and make a new key under New key. It starts with qr_live_ and is shown once, so copy it. Treat it like a password. Saving flows and starting or stopping runs need a full key. A read-only key can list and read flows and runs, and simulate.
export QR_API_KEY=qr_live_...
Run a recipe
curl -s -X POST https://api.quietrobot.ai/api/v1/runs \
-H "Authorization: Bearer $QR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipe":"fix-until-pass"}'
The answer is the new run, with its id (it starts with run_) and its status. The run shows in the dashboard too, so you can watch it on the canvas.
Check on it
curl -s https://api.quietrobot.ai/api/v1/runs/run_123 -H "Authorization: Bearer $QR_API_KEY"
Use your own run's id. Ask every few seconds until status is done, failed, stopped (it reached a limit) or cancelled. The answer lists every step with its output and cost. To stop a run early, send POST /runs/run_123/cancel.
Run a flow you saved, with tighter limits
Every saved flow has an id starting with flw_, shown in the builder's address bar. You can tighten its limits for one run:
curl -s -X POST https://api.quietrobot.ai/api/v1/flows/flw_123/runs \
-H "Authorization: Bearer $QR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"guards":{"maxLoops":3,"timeSec":600,"budgetUsd":0.50}}'
Write a flow as text, check it, save it
Every flow is one small document: a name, the flow itself under graph (its steps, nodes, and its arrows, edges), and its limits under guards. Here's the website check from Tutorial 7:
{
"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 }
}
Save it as flow.json, then check it before you save or run anything:
# Check it without saving or running it
curl -s -X POST https://api.quietrobot.ai/api/v1/flows/validate -H "Authorization: Bearer $QR_API_KEY" \
-H "Content-Type: application/json" -d @flow.json
# Save it as a new flow
curl -s -X POST https://api.quietrobot.ai/api/v1/flows -H "Authorization: Bearer $QR_API_KEY" \
-H "Content-Type: application/json" -d @flow.json
The check runs the same checks as Run in the builder: every step and arrow, your plan's limit on sandboxes at once, whether AI steps have their Claude key, and which steps your rules will likely hold for a person. A flow that wouldn't run gets valid: false and a list of problems, each pointing to its step and its place in your JSON. The saved flow opens in the builder like any other.
For a cost forecast first, POST /graphs/simulate gives the same estimate as the builder's Simulate button. Every call and field is on the Flows API page.
The JSON editor: the same document, on the canvas
You don't need the API to work with a flow as text. In the builder, press JSON in the toolbar (on a tablet or phone it's under More). The panel shows the flow you're editing as this same document.
- Edit it in place. About half a second after you stop typing, a valid change shows up on the canvas and saves. Undo works.
- Mistakes don't break your flow. If the text isn't a valid flow yet, the editor says Not applied and why, and the canvas keeps what it had. Go to line takes you to the problem.
- Checks under the editor. What the checks find is grouped as Before it can run, Will wait for a person and Left out (usually a typo, like
comandforcmd). - Fields lists every setting each kind of step can have.
- Copy JSON, Download .json, Import JSON. Keep a flow in your repository, share it with a teammate, or bring one in. An import asks first, and you can undo it.
Draw a flow and run its JSON from CI, or let your assistant write a flow and open the JSON panel to see exactly what it wrote. Imported flows follow your organization's rules, not the sender's, so read a flow's commands before you run it, as you would any script from the internet. The JSON editor page has the details.
Where to start
- Connect your AI app to
https://api.quietrobot.ai/mcpand ask: "Show me the Agent Playground recipes." - Ask it to save one as a flow, then open it on your canvas and look it over.
- When you want it in your own systems, make an API key and run it with one
curlcommand.
Tutorial 8 walks through all of it, and the Flows API and MCP tools pages have every call. Before you point a flow at anything important, read Limits and safety.