Workflows
Get workflow variables
Retrieve all variables available in a workflow, including both fixed system variables and variables discovered from execution history.
Returns two categories of variables:
- Fixed variables: Built-in system and context variables always available (flow_id, started_at, channel, phone_number, etc.)
- Discovered variables: User-defined variables observed during workflow executions, with sample values and usage statistics
Use this endpoint to:
- Understand what variables are available for use in workflow steps
- Review variable types and sample values for debugging
- Build autocomplete for variable references in workflow editors
GET
/
workflows
/
{workflow_id}
/
variables
Get workflow variables
curl --request GET \
--url https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables"
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}/variables', 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}/variables",
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}/variables"
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}/variables")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables")
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": {
"fixed": {
"system": {
"system.flow_id": {
"type": "string",
"description": "Flow identifier",
"always_available": true
},
"system.started_at": {
"type": "datetime",
"description": "Flow execution start time",
"always_available": true
}
},
"context": {
"context.channel": {
"type": "string",
"description": "Communication channel (api or whatsapp)",
"always_available": false
},
"context.phone_number": {
"type": "string",
"description": "Contact phone number",
"always_available": false
}
}
},
"discovered": {
"system": [],
"context": [],
"vars": [
{
"path": "vars.user_name",
"name": "user_name",
"type": "string",
"sample_values": [
"Alice",
"Bob"
],
"usage_count": 42,
"last_seen_at": "2025-01-15T10:30:00.000Z",
"reference": "{{vars.user_name}}"
}
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?
⌘I
Get workflow variables
curl --request GET \
--url https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables"
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}/variables', 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}/variables",
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}/variables"
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}/variables")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/platform/v1/workflows/{workflow_id}/variables")
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": {
"fixed": {
"system": {
"system.flow_id": {
"type": "string",
"description": "Flow identifier",
"always_available": true
},
"system.started_at": {
"type": "datetime",
"description": "Flow execution start time",
"always_available": true
}
},
"context": {
"context.channel": {
"type": "string",
"description": "Communication channel (api or whatsapp)",
"always_available": false
},
"context.phone_number": {
"type": "string",
"description": "Contact phone number",
"always_available": false
}
}
},
"discovered": {
"system": [],
"context": [],
"vars": [
{
"path": "vars.user_name",
"name": "user_name",
"type": "string",
"sample_values": [
"Alice",
"Bob"
],
"usage_count": 42,
"last_seen_at": "2025-01-15T10:30:00.000Z",
"reference": "{{vars.user_name}}"
}
]
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}
