Create Flow
Creates a new flow (agent) with an optional initial state.
POST /api/agent-react-flow
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Flow name |
states | array | No | Array of flow states |
Example
{
"name": "Invoice Extractor",
"states": [
{
"version": 1,
"nodes": [
{
"id": "node-input-1",
"type": "input",
"data": {
"label": "Input",
"format": "file_input",
"content": {}
},
"measured": { "width": 240, "height": 80 },
"position": { "x": 80, "y": 120 }
},
{
"id": "node-output-1",
"type": "output",
"data": {
"label": "Output",
"format": "json_output",
"content": {}
},
"measured": { "width": 240, "height": 80 },
"position": { "x": 520, "y": 120 }
}
],
"edges": [
{ "id": "edge-1", "source": "node-input-1", "target": "node-output-1" }
],
"selectedEdge": null,
"selectedNode": null
}
]
}
