Automate Whatsapp
Build and debug Kapso WhatsApp workflows, triggers, functions, and executions.
- Skill ID
- gokapso/agent-skills/automate-whatsapp
- Publisher
- gokapso
- Repository
- agent-skills
- Installs
- 0
- Files
- 61
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
gokapso/agent-skills/automate-whatsappInstalls these files- SKILL.md
- assets/agent-remote-sandbox-github-repo-example.json
- assets/function-decide-route-interactive-buttons.json
- assets/functions-example.json
- assets/workflow-agent-simple.json
- assets/workflow-api-template-wait-agent.json
- assets/workflow-customer-support-intake-agent.json
- assets/workflow-decision.json
- assets/workflow-interactive-buttons-decide-ai.json
- assets/workflow-interactive-buttons-decide-function.json
- assets/workflow-linear.json
- package.json
- references/agent-remote-sandbox.md
- references/execution-context.md
- references/function-contracts.md
- references/functions-payloads.md
- references/functions-reference.md
- references/graph-contract.md
- references/local-workflow-source.md
- references/node-types.md
- references/triggers.md
- references/workflow-overview.md
- references/workflow-reference.md
- scripts/create-function.js
- scripts/create-trigger.js
- scripts/create-workflow.js
- scripts/delete-trigger.js
- scripts/deploy-function.js
- scripts/edit-graph.js
- scripts/get-context-value.js
- scripts/get-execution-event.js
- scripts/get-execution.js
- scripts/get-function.js
- scripts/get-graph.js
- scripts/get-workflow.js
- scripts/invoke-function.js
- scripts/lib/functions/args.js
- scripts/lib/functions/kapso-api.js
- scripts/lib/workflows/args.js
- scripts/lib/workflows/kapso-api.js
- scripts/lib/workflows/result.js
- scripts/list-execution-events.js
- scripts/list-executions.js
- scripts/list-function-invocations.js
- scripts/list-functions.js
- scripts/list-provider-models.js
- scripts/list-triggers.js
- scripts/list-whatsapp-phone-numbers.js
- scripts/list-workflows.js
- scripts/openapi-explore.mjs
- scripts/project-event-definitions.js
- scripts/resume-execution.js
- scripts/update-execution-status.js
- scripts/update-function.js
- scripts/update-graph.js
- scripts/update-trigger.js
- scripts/update-workflow-settings.js
- scripts/validate-graph.js
- scripts/variables-delete.js
- scripts/variables-list.js
- scripts/variables-set.js
What this skill tells the agent
Automate WhatsApp
When to use
Use this skill to build and run WhatsApp automations: workflow CRUD, graph edits, WhatsApp and Project Event triggers, Project Event emissions, executions, function management, webhook tools, and MCP tools.
Setup
Preferred path:
- Kapso CLI installed and authenticated (
kapso login) - For workflow and function edits, use source-controlled projects with
kapso link,kapso pull,kapso build, andkapso push - For workflow code, use
@kapso/workflowsand export aWorkflowinstance fromworkflow.jsorworkflow.ts
Fallback path: Env vars:
KAPSO_API_BASE_URL(host only, no/platform/v1)KAPSO_API_KEY
How to
Edit workflows locally
Use this path first when the user is working in, or can create, a local repo.
npm install -g @kapso/cli
npm install --save-dev @kapso/workflows
kapso login
kapso link --project <project-id>
kapso pullEdit workflows/<workflow-slug>/workflow.js or workflow.ts with @kapso/workflows:
import { START, Workflow } from "@kapso/workflows";
const workflow = new Workflow("inbound-support", {
name: "Inbound Support",
status: "draft",
});
workflow.addTrigger({
type: "inbound_message",
phoneNumberId: "<phone-number-id>",
});
workflow.addNode(START, {
position: { x: 100, y: 100 },
});
workflow.addNode("reply", {
type: "send_text",
message: "Thanks for reaching out.",
});
workflow.addEdge(START, "reply");
export default workflow;Build and push:
kapso build
kapso push --dry-run
kapso push workflow <workflow-slug>Use kapso push to push every local function and workflow. See references/local-workflow-source.md for repo layout, source-file behavior, and JSON-only editing.
Discover phone numbers first
Preferred path:
- Check project state:
kapso status - List connected numbers:
kapso whatsapp numbers list --output json - Resolve a display number when needed:
kapso whatsapp numbers resolve --phone-number "<display-number>" --output json
Fallback path:
- List number configs for triggers:
node scripts/list-whatsapp-phone-numbers.js
Edit a workflow graph through API scripts
Prefer local source sync for workflow edits. Use these scripts as a fallback for debugging, direct graph inspection, or API-only environments.
- Fetch graph:
node scripts/get-graph.js <workflow_id>(note thelock_version) - Edit the JSON (see graph rules below)
- Validate:
node scripts/validate-graph.js --definition-file <path> - Update:
node scripts/update-graph.js <workflow_id> --expected-lock-version <n> --definition-file <path> - Re-fetch to confirm
For small edits, use edit-graph.js with --old-file and --new-file instead.
If you get a lock_version conflict: re-fetch, re-apply changes, retry with new lock_version.
Manage triggers
- List:
node scripts/list-triggers.js <workflow_id> - Create:
node scripts/create-trigger.js <workflow_id> --trigger-type <type> --phone-number-id <id> - Toggle:
node scripts/update-trigger.js --trigger-id <id> --active true|false - Delete:
node scripts/delete-trigger.js --trigger-id <id>
For inbound_message triggers, prefer kapso whatsapp numbers resolve --phone-number "<display-number>" --output json to get the exact phone_number_id. Fall back to node scripts/list-whatsapp-phone-numbers.js when the CLI is unavailable.
For project_event triggers, register or update the Project Event definition first when the user is defining an event type/schema:
node scripts/project-event-definitions.js create \
--name conversation.csat_scored \
--description "Customer satisfaction score for a conversation" \
--property-schema '{"score":{"type":"number"},"reason":{"type":"string"}}'Then create the trigger:
node scripts/create-trigger.js <workflow_id> \
--trigger-type project_event \
--triggerable-attributes '{"event_name":"conversation.csat_scored","property_key":"score","operator":"gte","property_value":4}'Definitions are metadata only. Do not emit a sample event just to register a name unless the user explicitly accepts that side effect.
Manage Project Event definitions
Use definitions for event names, descriptions, and flat scalar property schemas. Emitted events are separate records created by POST /platform/v1/events, emit_event nodes, Function node project_events, or Agent node emit_event.
- List:
node scripts/project-event-definitions.js list - Create/update by name:
node scripts/project-event-definitions.js create --name <event.name> [--description <text>] [--property-schema <json>] - Update by ID:
node scripts/project-event-definitions.js update --definition-id <id> [--name <event.name>] [--description <text>] [--property-schema <json>]
Build workflows with Project Events
Use this checklist when a workflow needs to remember or react to durable business facts:
- Define the event first when the user is introducing a new event name or schema.
- Use
project_eventtriggers when a workflow should react to an emitted event. - Use an
emit_eventnode for deterministic workflow-step emission. - Use Function node
project_eventswhen emission depends on function code output. - Use Agent node
emit_eventonly when the agent should decide whether/when to record the fact. Enable theemit_eventdefault tool and configure allowed event definitions before relying on it.
Project-event-triggered workflows are observers and cannot emit Project Events. Do not add event emission to a workflow that starts from a Project Event trigger.
Debug executions
- Search workflow logs first when you have an execution ID:
kapso logs search --query "<execution-id>" --source flow_event --filter flow_execution_id=<execution-id> --period 7d --limit 20 --output json - List:
node scripts/list-executions.js <workflow_id> - Inspect:
node scripts/get-execution.js <execution-id> - Get value:
node scripts/get-context-value.js <execution-id> --variable-path vars.foo - Events:
node scripts/list-execution-events.js <execution-id>
Create and deploy a function
- Write code with handler signature (see function rules below)
- Create:
node scripts/create-function.js --name <name> --code-file <path> [--public-endpoint true] - Deploy:
node scripts/deploy-function.js --function-id <id> - Verify:
node scripts/get-function.js --function-id <id>
Use --public-endpoint true when the function should be callable without X-API-Key via the Kapso-hosted invoke URL. This is only supported for Cloudflare functions. New functions default to invoke_response_mode=passthrough, which returns the function body directly on successful invoke. Legacy wrapped functions can be migrated later with update-function.js.
Set up agent node with remote sandbox repositories
Use this when the agent needs a remote ephemeral workspace to inspect or modify repository files during a workflow run.
- Read
references/agent-remote-sandbox.mdfor the execution model and field rules - Find model:
node scripts/list-provider-models.js - Copy
assets/agent-remote-sandbox-github-repo-example.jsonas a starting point, or edit the agent node underdata.config - Set
sandbox_enabled: true - Set
sandbox_network_modetoallow_allorallow_list - If using
allow_list, add extra outbound hosts insandbox_allowed_outbound_hosts - Add GitHub repositories to
flow_agent_resourceswith:
resource_type: "github_repository"repo_urlbranchpat
- Write the system prompt so it explicitly reads from
/workspace/repos/<repo-slug>before making changes - Validate and update the graph
Notes:
- Remote sandbox is beta and free during the beta
sandbox_enabledcontrols whether the remote workspace and sandbox tools are available- Repository resources stay configured even if sandbox access is turned off later
- v1 supports GitHub repositories only
More from gokapso
Use this skill in a project
Open any RiverX project, search the Skills panel for gokapso/agent-skills/automate-whatsapp, and install it in one click.
