Workflows
Retrieve workflow definition
Get the editor-oriented workflow payload for a specific workflow.
This endpoint returns everything needed to load the canvas:
- Base workflow metadata
definition.nodesbuilt fromflow_stepsdefinition.edgesbuilt fromflow_edges
Response details:
definition.nodes[].idis the workflow step identifier, not the database IDdefinition.edges[].idis the persisted edge UUIDdefinition.nodes[].data.node_typeis the canonical backend node typedefinition.nodes[].data.configchanges shape by node type- Config fields are returned in snake_case
- Function and call-workflow references are returned as IDs in the Platform API; the Kapso CLI can export them as slugs for local source repos
Use this endpoint when building or syncing a visual workflow editor, exporting a workflow graph, or cloning an existing workflow definition.
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>'import requests
url = "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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:22.000Z",
"updated_at": "2026-03-12T09:44:18.000Z",
"project_id": "7b7d09f1-4f2d-477c-bb1c-0fc8d1bb6d3e",
"execution_count": 12,
"last_executed_at": "2026-03-12T09:40:05.000Z",
"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",
"phone_number_id": "15551234567",
"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
}
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Path Parameters
Workflow identifier
Response
Workflow definition retrieved successfully
Single workflow response including the canvas definition and editor metadata
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.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Retrieve workflow definition
curl --request GET \
--url https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/definition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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:22.000Z",
"updated_at": "2026-03-12T09:44:18.000Z",
"project_id": "7b7d09f1-4f2d-477c-bb1c-0fc8d1bb6d3e",
"execution_count": 12,
"last_executed_at": "2026-03-12T09:40:05.000Z",
"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",
"phone_number_id": "15551234567",
"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
}
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}
