Create Flow

Creates a new flow (agent) with an optional initial state.

POST /api/agent-react-flow

Request body

FieldTypeRequiredDescription
namestringYesFlow name
statesarrayNoArray 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
    }
  ]
}