Edit a flow draft from chat in the v2 flow editor.
Open the flow agent
- Open a flow at
/flows/{id}in the v2 editor. - Stay in flow view, not the app run view.
- In the bottom-left toolbar, next to undo and redo, click agent.
A flow agent panel opens on the right. It runs the platform agent infsh/flow-agent. The button shows only when you can edit the flow.
The chat takes text only; it does not accept files or images.
What it can do
Ask it to build or change the draft graph: add app and utility nodes, connect steps, wire inputs, set the flow input schema, map outputs, rename nodes, tidy the layout, or undo recent edits.
- "Add an upscale app after
generate_imageand wire the image output." - "Define flow inputs:
text(string, required) andvoice(file)." - "Organize the canvas and map the final image to the output node."
Agent edits and manual edits go to the same draft, and collaborators see them through the editor's sync.
How edits reach the graph
The agent runs on the platform. Graph changes run in your browser as client tools, on the same path the editor uses before it calls POST /flows/{id}/actions.
| Client tool | Purpose |
|---|---|
get_flow_state | Snapshot of the draft: each node's id, type, position, app ids, input and output field names, edges, wired values (formValues) and outputMappings |
search_apps | Search the app catalog; returns app_id, app_version_id and ref for node.add |
apply_flow_actions | Apply a batch of graph actions |
organize_nodes | Auto-arrange the canvas |
apply_flow_actions
Takes an actions array of the graph action types (node.add, edge.add, node.set_input, flow.set_output_mapping and the rest).
| Rule | Detail |
|---|---|
| Batch | The editor applies the batch at once, then syncs it to the server |
undo / redo | Must be the only action in the batch: [{ "type": "undo" }]. They use the same per-user action log as the toolbar buttons (Undo and redo) |
node.add | Include app_id and app_version_id from search_apps in payload.data. The panel loads the app version so node forms and schemas work |
| Connections | node.set_input with a connection gets connection.type from the source node's output schema when it is omitted |
| Output mappings | flow.set_output_mapping gets mapping.schema and mapping.type from the source output field when they are omitted |
| Errors | A batch that fails validation or that the server rejects returns { error: "…" }: empty actions, an unknown action type, an app version not found, an output the source node doesn't have, or the editor's sync error. The tool call is marked failed and the model reads the text |
Without the web app, edit the graph with POST /flows/{id}/actions or belt flow edit (Apply graph actions).