The Agent window (right side of the editor by default) is an AI assistant that knows this flow. It can explain it, plan a change, or build and test the change itself, on one of your Dataset › AI keys.
Modes
| Mode | Reads the flow | Task list | Edits the flow | Runs tests |
|---|---|---|---|---|
| Ask | yes | no | no | no |
| Plan | yes | yes | no | no |
| Agent | yes | yes | yes, live (in its draft, or directly for a small change) | yes (with your approval) |
In Plan mode, press Implement to switch to Agent mode with "Implement the plan."
Starting a conversation
Everything you send from sits in one box (the composer):
- Context cards above the message:
- The selection on the canvas shows as a dashed card. It goes with your next message; pin it to keep it after you deselect, × to leave it out.
- Pinned nodes, #run (the editor's last run: each step's status and output) and #log (its logs) go with every message until you remove them. They're saved with the conversation. A pinned node you later delete from the flow shows struck through and is skipped.
- Images (picked or pasted screenshots, three at most) go with the next message; pin one to send it every time. They're sent to the model but not stored.
- Under the message: + (add an image, the last run, its logs, or a node by name), the mode (Ask / Plan / Agent) and the model picker (AI key › model › effort; hover it for the conversation's token use).
- Typing
#runor#login the message attaches them once.
Examples:
Ask: Why does Find on Shopee sometimes take the error dot?
Plan: Add a step that saves every reply we post into my "Replies" table.
Agent: After Reply, insert a Data table node that inserts { url, text, at } into "Replies", then test run from Collect posts.
What the agent can do (tools)
| Tool | What it does |
|---|---|
flow_read | The canvas it works on, as compact text (with each node's description). |
canvas_list / canvas_open | The flow's ; switch the canvas it works on. |
canvas_draft | Its draft: a copy of main, locked to its conversation (one per conversation). |
canvas_new | A new canvas (not a draft) it works on, e.g. a part main calls with Run flow (flowId: "canvas:<id>"). |
canvas_sync | Update its draft from main; conflicts come back, settled with resolve. |
canvas_lock / canvas_unlock | Lock a canvas; unlock only when you ask (the lock passes to you). |
canvas_delete | Delete its own draft once the work is kept, undone or abandoned. |
node_type | A node type's fields, options and output dots. |
node_get | One node in full. |
flow_edit | Edit with ops: add (with after: "<id>.<handle>" to connect or insert), update (fields/settings merged), remove, connect, disconnect; each node gets a description. Written live on the canvas it works on. Agent mode only. |
run | A test run of the canvas it works on, whole or a range (from / to). Effect nodes are simulated. Agent mode only. |
run_read | The last run's logs, or one node's full output. |
ask_user | Asks you something (an account, a choice) and ends its turn. |
todo | Its task list (Plan and Agent modes). |
Example flow_edit call:
{
"ops": [
{ "op": "add", "type": "data/table", "id": "save", "name": "Save reply", "after": "reply.next", "field": { "operation": "insert" } },
{ "op": "update", "id": "reply", "setting": { "retry": { "count": 1, "waitMs": 5000 } } }
]
}
It works live, on the canvas
The agent edits the flow's as it goes: everyone with the flow open watches nodes appear, with a spark on what it changed last.
- Real work (building, rewiring, anything it tests): it makes its draft, a copy of main locked to its conversation, then edits and test-runs there. Main doesn't change until you keep the draft. Your canvas tabs follow to the canvas it works on and tests.
- A small change (a few nodes, a rename, a field, no test run): it edits the canvas you're looking at directly. The nodes it touched get a spark, and the chat shows a Changed Main card listing what it did ("added fetch", "added read") with Undo (what it changed goes back, what others changed since stays) and Keep (the sparks go).
Every message tells it where you are: the open canvas, your selection, the nodes on your screen and the windows you have open. When it makes or returns to its draft, your canvas tabs follows it there.
When a tool call is malformed
Models sometimes put raw line breaks or tabs inside a string (a Code node's code, a long prompt), which isn't valid JSON. The agent repairs that before reading the call. If a call still can't be read (for example it was cut off), the agent is told exactly that and sends it again, smaller; the server log keeps the raw text.
How the chat reads
- Your messages are quiet grey bubbles; the mode shows only when it isn't Agent.
- The agent's steps fold into one row, Worked · 5 steps (failed ones counted in red, a spinner while it works); open it to see each step.
- Every response shows its tokens: under each reply, and summed on each Worked row (
1.2K in · 80% cached · 300 out, and the cost when the key has prices). - While it works, the status line counts the turn's tokens so far ("Thinking… 32K in · 91% cached · 1.1K out"), going up with each response until the turn is done.
- A test run is a small card (Test run · Succeeded) with each node's result folded under it (wrapped to the chat's width, scrolling when long).
- An approval you answered shrinks to one line ("Test run of the whole flow · Allowed for this conversation").
The Changes bar
Above the message box, the conversation's draft shows like GitHub's merge box: "3 changes in Fetch and read google.com". It reads the draft itself, so it's the same in every tab and for everyone.
- One line per node (Added, Changed, Removed) with a tick (untick to leave it out of Keep) and Diff (where the draft started on the left, the draft now on the right); connections are counted below.
- Show on canvas opens the draft; its new nodes are outlined green, changed ones amber, until you keep it.
- Keep (Squash) merges the draft into main; the arrow picks Squash, Merge or Rebase (see ). Conflicts with main list here: pick Main's or Draft's, or Resolve with agent.
- Update from main brings main's changes into the draft. Undo all deletes the draft.
Keep and Undo wait while that conversation is working.
Approvals and Autopilot
Running a test asks first: Allow this? Test run Collect posts → end with Allow once, Allow for this conversation or Deny.
Autopilot runs tools without asking and allows up to 75 steps a turn (25 otherwise). Hitting the limit shows "Stopped after 25 steps." with Continue; so does Stop ("You stopped it."), keeping what the turn already did.
The chat and the list show what a conversation does: Thinking, Running {tool}, Waits for your approval or Asked you something.
Steer while it works
While a turn runs you can type again:
- Send now joins what it's doing (it reads your message between steps).
- Queue for after this turn waits until it finishes (the queue lives on the server, so a reload keeps it; × drops one).
- Stop ends the turn and drops the queue.
A turn runs on the server by itself: reloading, closing the tab or opening another conversation doesn't stop it. Up to three of your conversations can work at once. A conversation's test run shows on the canvas only while that conversation is open.
Edit and ask again
Hover your last message (not an approval or option you picked): Edit puts it back in the box (sending replaces it and everything after it), Ask again sends it again. Changes it made and runs it did stay done (it asks first when there are any); undo a change from the chat, or revert a kept draft in Version history.
Conversations and instructions
- New conversation (the pen at the top left) starts fresh; it's made by its first message, with the AI choice and Autopilot you picked. After the first turn the AI names it (a name you give wins).
- Deleting a conversation also deletes its drafts.
- Conversations sits beside the chat when the Agent window is wide (about 670px or more: widen the right area). Drag its left edge to resize it (200–480px, remembered in this browser). In a narrower window the clock button at the top left swaps the chat for the list; picking a conversation goes back to the chat.
- Search by title; switch between Recent and Archived.
- Each conversation's menu: Rename (empty puts its first message back as the title), Archive / Unarchive, Delete (asks first; what it changed and kept stays on the flow).
- Deleting the open conversation leaves a new one. Sending a message to an archived conversation brings it back out of the archive.
- The list updates live in every tab and device of yours: titles, order, and a spinner or dot for conversations that work or wait for you.
- Conversations are yours: others on the flow have their own.
- Instructions for this flow: what the agent should always keep in mind (accounts, tone, language, things to avoid).
- Token use shows beside the send button for the open conversation:
535K in · 94% cached · 11K out(and its cost when the key has prices). Hover it for the full numbers: input, cached, not cached, output, total, cost.
How it works
POST /api/studio/agentstarts a turn on a conversation (sessionIdnull makes one) and answers{ sessionId }at once; the turn runs on the server (controllers/studio/agent/hub.ts) and is queued when that conversation already works.GET /api/studio/agent/stream?workspace=&flowId=&offset=carries every change to your conversations on the flow as NDJSON lines{ offset, sessionId, event }: the last 10 minutes first, a{ live: true }line, then live. The agent store (stores/studio/agent) loads the list and the open conversation, then replays the stream over them; a dropped stream does it again.- Stop, steer, rename, archive, pin context, undo a change and delete are server actions; each change also goes through the stream. Keep, Undo all and Update from main are canvas actions (
aStudioCanvasKeep,Undo,Sync). - The agent reads and writes canvases on the server through the live document (
flowCanvas), so every edit reaches everyone at once; its runs carryby: "agent"and show a spark. - The session is saved after every step. The system prompt starts with a stable part (role, rules, the node catalog by name) so the provider's prompt cache stays warm.
- Context upkeep runs only past ~40k characters and then all at once, so the cached prefix stays put for many turns after: old tool results are cleared first (the agent calls the tool again if needed); if it's still that large, older turns fold into a summary under Goals, Decisions, Done, Open and Nodes.
- If the server stops mid-turn, the conversation shows as idle again (a saved "working" status without a running turn counts as idle). Archiving or renaming during a turn sticks; the AI only names a conversation you haven't named.
- One server only: running turns live in its memory (several servers would need Redis).
FAQ
Does the agent know about options, limits and no repeats?
Yes. Its instructions say accounts and AI keys come from the flow's options ({{ option.account.x }}, {{ option.ai }}, never an id), that pacing and repeats are node settings (setting.limit, setting.unique) rather than extra nodes, and that Write and Extract JSON can decline. Its summary of your flow shows each node's limit= and unique= settings, and it routes limited, duplicate and declined back to the round.
Where did my old conversation go?
Open Conversations and switch to Archived, or search for its title. Deleted conversations can't come back.
Can the agent post or reply for real?
No. Its run tool only does test runs, where effect nodes are simulated.
The agent says "Add an AI key in Dataset to use the agent."
Create one in Dataset › AI, then pick it in the panel.
Can I undo something I kept?
Yes: press Revert on its version in Version history. A small direct change has Undo in the chat.
Does the agent make a draft for everything?
No. It uses a draft for real work and anything it tests; a small change (a few nodes, no test run) goes straight onto the canvas you're on, as one step you can undo. Say "use a draft" or "do it directly" to choose.