Skip to main content
GET
/
workflows
/
{workflow_id}
/
definition
Retrieve workflow definition
curl --request GET \
  --url https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition \
  --header 'X-API-Key: <api-key>'
{
  "data": {
    "id": "2c2d03de-f8e5-4e9d-87fd-d168a8d04a6c",
    "name": "Lead qualification",
    "description": "Qualify inbound leads before handing off to sales",
    "status": "draft",
    "lock_version": 3,
    "message_debounce_seconds": 1,
    "inbound_message_read_mode": "read_with_typing",
    "created_at": "2026-03-10T14:05:22Z",
    "updated_at": "2026-03-12T09:44:18Z",
    "project_id": "7b7d09f1-4f2d-477c-bb1c-0fc8d1bb6d3e",
    "execution_count": 12,
    "last_executed_at": "2026-03-12T09:40:05Z",
    "definition": {
      "nodes": [
        {
          "id": "start",
          "type": "flow-node",
          "position": {
            "x": 120,
            "y": 80
          },
          "data": {
            "node_type": "start",
            "config": {},
            "display_name": "Start"
          }
        },
        {
          "id": "send_intro",
          "type": "flow-node",
          "position": {
            "x": 380,
            "y": 80
          },
          "data": {
            "node_type": "send_text",
            "config": {
              "whatsapp_config_id": "ab11ff46-0f30-49e5-b5ef-a78662bc0ef1",
              "message": "Hi {{vars.first_name}}, thanks for contacting us.",
              "delay_seconds": 0,
              "provider_model_id": null,
              "provider_model_name": null,
              "ai_field_config": {},
              "to_phone_number": null
            },
            "display_name": "Send Text Message"
          }
        },
        {
          "id": "wait_reply",
          "type": "flow-node",
          "position": {
            "x": 660,
            "y": 80
          },
          "data": {
            "node_type": "wait_for_response",
            "config": {
              "has_timeout": true,
              "timeout_seconds": 300,
              "save_response_to": "latest_reply"
            },
            "display_name": "Wait for response"
          }
        }
      ],
      "edges": [
        {
          "id": "6952ed87-5016-444d-a145-7339c4d3c642",
          "source": "start",
          "target": "send_intro",
          "label": "next",
          "type": "default",
          "flow_condition_id": null
        },
        {
          "id": "0c2b6fc5-eb0c-41cc-8dcf-6aa4f5dd6ca1",
          "source": "send_intro",
          "target": "wait_reply",
          "label": "next",
          "type": "default",
          "flow_condition_id": null
        }
      ]
    }
  }
}

Authorizations

X-API-Key
string
header
required

Path Parameters

workflow_id
string<uuid>
required

Workflow identifier

Response

Workflow definition retrieved successfully

Single workflow response including the canvas definition and editor metadata

data
object
required

Expanded workflow payload returned by GET /workflows/{workflow_id}/definition. This is the editor-oriented response: it contains the workflow metadata plus the full canvas graph.