Use the Kapso CLI to keep workflows and functions in a local repository. You can edit the generatedDocumentation Index
Fetch the complete documentation index at: https://docs.kapso.ai/llms.txt
Use this file to discover all available pages before exploring further.
definition.json directly, or use @kapso/workflows to author the workflow in JavaScript or TypeScript.
The Platform API stores workflow definitions as JSON with snake_case config keys. The JavaScript library uses idiomatic camelCase inputs and compiles them to the same JSON shape before kapso push.
Start a local repo
kapso link binds the current directory to one Kapso project. kapso pull downloads source files for workflows and functions.
Repository layout
After pulling, the repo includes project binding metadata and one directory per source object..kapso/remote-map.json in shared repos because it stores the last pulled remote state for dirty-file and stale-update checks.
Choose JSON or code
Both paths are supported:- Edit
definition.jsonwhen you want the exact Platform API graph payload. - Edit
workflow.jsorworkflow.tswhen you want a boring code API for constructing the graph. - Keep or ignore generated
definition.jsonas a team decision. The CLI works either way.
kapso pull creates workflow.js next to definition.json when no workflow source file exists. After you edit that source file, future pulls preserve it and update only the remote-owned JSON/YAML files.
Build with code
workflow.js file is unchanged, kapso push uses workflow.yaml and definition.json. Once you edit workflow.js or add workflow.ts, kapso push compiles that source before uploading.
Push changes
Preview changes before writing to Kapso:kapso pull first.
Node reference
Each node has a stableid, a type, and optional display/position options. Edges reference node IDs.
node_type.
| Node | API node_type | Library config |
|---|---|---|
| Start | start | workflow.addNode(START, { position }) |
| Send text | send_text | { type: "send_text", message, phoneNumberId?, toPhoneNumber?, delaySeconds?, providerModel?, aiFields? } |
| Send template | send_template | { type: "send_template", templateId, parameters?, phoneNumberId?, toPhoneNumber?, providerModel?, aiFields? } |
| Send interactive | send_interactive | { type: "send_interactive", interactiveType, bodyText?, buttons?, listSections?, ctaUrl?, flowId?, phoneNumberId?, toPhoneNumber? } |
| Wait for response | wait_for_response | { type: "wait_for_response", saveResponseTo?, timeoutSeconds? } |
| Decide | decide | { type: "decide", decisionType: "ai" / "function", conditions, providerModel? } or { functionSlug } for function decisions |
| Function | function | { type: "function", functionSlug, saveResponseTo? } |
| Webhook | webhook | { type: "webhook", url, method?, headers?, bodyTemplate?, saveResponseTo?, providerModel?, aiFields? } |
| App action | pipedream | { type: "pipedream", appSlug, actionId, accountId?, configuredProps?, saveResponseTo? } |
| Agent | agent | { type: "agent", systemPrompt, providerModel?, functionTools?, webhooks?, mcpServers?, resources? } |
| Call workflow | call | { type: "call", workflowSlug, saveErrorTo? } |
| Handoff | handoff | { type: "handoff", reason?, contextData? } |
| Set variable | set_variable | { type: "set_variable", variableName, variableValue, valueType? } |
| Raw | any | { type: "raw", nodeType, config } for fields not yet modeled by the library |
rawConfig on typed nodes when you need an extra Platform API field that the library has not modeled yet:
References by slug
Local source should use stable slugs where possible:- Function nodes use
functionSlug. - Function decision nodes use
functionSlug. - Agent function tools use
functionSlug. - Call workflow nodes use
workflowSlug.
kapso push, the CLI resolves those slugs to remote IDs before calling the Platform API. Direct Platform API requests should use function_id and workflow_id.
API definition shape
A workflow definition is a graph:- Use
snake_caseconfig keys. - Use
GET /workflows/{workflow_id}/definitionto read the expanded graph. - Use
PATCH /workflows/{workflow_id}to update metadata and graph collections. - Include the latest
lock_versionto avoid overwriting remote changes. - The update response returns workflow metadata, not the expanded definition. Refetch the definition when you need the saved graph.
definition, nodes and edges are replacement sets when present. If you send only one node in definition.nodes, every other node is removed. Omit definition.nodes or definition.edges when you want that collection to remain unchanged.
Sync behavior
The CLI protects local and remote work during sync:kapso pullrefuses to overwrite dirty local remote-owned files.kapso pull --diffshows blocked incoming diffs without writing files.kapso pull --overwritereplaces local edits in remote-owned files with the remote version.kapso pullpreserves authoredworkflow.jsandworkflow.tsfiles.kapso pushchecks the last pulled remote version before updating existing objects.- Remote-only workflows and functions are reported, not deleted.
- Local-only workflows and functions are created on push.
Build with AI
The setup block above installs the Kapso agent skills. For AI-assisted edits, point your coding assistant at the workflow directory and ask it to editworkflow.js or workflow.ts.
Kapso docs are available to AI tools through the MCP endpoint:

