automate-whatsapp
Original:🇺🇸 English
Translated
Build WhatsApp automations with Kapso workflows: configure WhatsApp triggers, edit workflow graphs, manage executions, deploy functions, and use databases/integrations for state. Use when automatin...
2installs
Added on
NPX Install
npx skill4agent add sickn33/antigravity-awesome-skills automate-whatsappTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Automate WhatsApp
When to use
Use this skill to build and run WhatsApp automations: workflow CRUD, graph edits, triggers, executions, function management, app integrations, and D1 database operations.
Setup
Env vars:
- (host only, no
KAPSO_API_BASE_URL)/platform/v1 KAPSO_API_KEY
How to
Edit a workflow graph
- Fetch graph: (note the
node scripts/get-graph.js <workflow_id>)lock_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 with and instead.
edit-graph.js--old-file--new-fileIf 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, first run to get .
node scripts/list-whatsapp-phone-numbers.jsphone_number_idDebug executions
- 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> - Deploy:
node scripts/deploy-function.js --function-id <id> - Verify:
node scripts/get-function.js --function-id <id>
Set up agent node with app integrations
- Find model:
node scripts/list-provider-models.js - Find account: (use
node scripts/list-accounts.js --app-slug <slug>)pipedream_account_id - Find action: (action_id = key)
node scripts/search-actions.js --query <word> --app-slug <slug> - Create integration:
node scripts/create-integration.js --action-id <id> --app-slug <slug> --account-id <id> --configured-props <json> - Add tools to agent node via
flow_agent_app_integration_tools
Database CRUD
- List tables:
node scripts/list-tables.js - Query:
node scripts/query-rows.js --table <name> --filters <json> - Create/update/delete with row scripts
Graph rules
- Exactly one start node with =
idstart - Never change existing node IDs
- Use for new node IDs
{node_type}_{timestamp_ms} - Non-decide nodes have 0 or 1 outgoing edge
next - Decide edge labels must match
conditions[].label - Edge keys are /
source/target(notlabel/from)to
For full schema details, see .
references/graph-contract.mdFunction rules
js
async function handler(request, env) {
// Parse input
const body = await request.json();
// Use env.KV and env.DB as needed
return new Response(JSON.stringify({ result: "ok" }));
}- Do NOT use ,
export, or arrow functionsexport default - Return a object
Response
Execution context
Always use this structure:
- - user-defined variables
vars - - system variables
system - - channel data
context - - request metadata
metadata
Scripts
Workflows
| Script | Purpose |
|---|---|
| List workflows (metadata only) |
| Get workflow metadata |
| Create a workflow |
| Update workflow settings |
Graph
| Script | Purpose |
|---|---|
| Get workflow graph + lock_version |
| Patch graph via string replacement |
| Replace entire graph |
| Validate graph structure locally |
Triggers
| Script | Purpose |
|---|---|
| List triggers for a workflow |
| Create a trigger |
| Enable/disable a trigger |
| Delete a trigger |
| List phone numbers for trigger setup |
Executions
| Script | Purpose |
|---|---|
| List executions |
| Get execution details |
| Read value from execution context |
| Force execution state |
| Resume waiting execution |
| List execution events |
Functions
| Script | Purpose |
|---|---|
| List project functions |
| Get function details + code |
| Create a function |
| Update function code |
| Deploy function to runtime |
| Invoke function with payload |
| List function invocations |
App integrations
| Script | Purpose |
|---|---|
| Search integration apps |
| Search actions (action_id = key) |
| Get action JSON schema |
| List connected accounts |
| Create OAuth connect link |
| Resolve remote_options for a prop |
| Reload dynamic props |
| List saved integrations |
| Create an integration |
| Update an integration |
| Delete an integration |
Databases
| Script | Purpose |
|---|---|
| List D1 tables |
| Get table schema + sample rows |
| Query rows with filters |
| Create a row |
| Update rows |
| Upsert a row |
| Delete rows |
OpenAPI
| Script | Purpose |
|---|---|
| Explore OpenAPI (search/op/schema/where) |
Install deps (once):
bash
npm iExamples:
bash
node scripts/openapi-explore.mjs --spec workflows search "variables"
node scripts/openapi-explore.mjs --spec workflows op getWorkflowVariables
node scripts/openapi-explore.mjs --spec platform op queryDatabaseRowsNotes
- Prefer file paths over inline JSON (,
--definition-file)--code-file - is the same as
action_idfromkeysearch-actions - uses
--account-idfrompipedream_account_idlist-accounts - Variable CRUD (,
variables-set.js) is blocked - Platform API doesn't support itvariables-delete.js - Raw SQL execution is not supported via Platform API
References
Read before editing:
- references/graph-contract.md - Graph schema, computed vs editable fields, lock_version
- references/node-types.md - Node types and config shapes
- references/workflow-overview.md - Execution flow and states
Other references:
- references/execution-context.md - Context structure and variable substitution
- references/triggers.md - Trigger types and setup
- references/app-integrations.md - App integration and variable_definitions
- references/functions-reference.md - Function management
- references/functions-payloads.md - Payload shapes for functions
- references/databases-reference.md - Database operations
Assets
| File | Description |
|---|---|
| Minimal linear workflow |
| Minimal branching workflow |
| Minimal agent workflow |
| Customer support intake |
| Interactive buttons + decide (function) |
| Interactive buttons + decide (AI) |
| API trigger + template + agent |
| Function for button routing |
| Agent node with app integrations |
Related skills
- - Onboarding, webhooks, messaging, templates, flows
integrate-whatsapp - - Debugging, logs, health checks
observe-whatsapp
text
[automate-whatsapp file map]|root: .
|.:{package.json,SKILL.md}
|assets:{agent-app-integration-example.json,databases-example.json,function-decide-route-interactive-buttons.json,functions-example.json,workflow-agent-simple.json,workflow-api-template-wait-agent.json,workflow-customer-support-intake-agent.json,workflow-decision.json,workflow-interactive-buttons-decide-ai.json,workflow-interactive-buttons-decide-function.json,workflow-linear.json}
|references:{app-integrations.md,databases-reference.md,execution-context.md,function-contracts.md,functions-payloads.md,functions-reference.md,graph-contract.md,node-types.md,triggers.md,workflow-overview.md,workflow-reference.md}
|scripts:{configure-prop.js,create-connect-token.js,create-function.js,create-integration.js,create-row.js,create-trigger.js,create-workflow.js,delete-integration.js,delete-row.js,delete-trigger.js,deploy-function.js,edit-graph.js,get-action-schema.js,get-context-value.js,get-execution-event.js,get-execution.js,get-function.js,get-graph.js,get-table.js,get-workflow.js,invoke-function.js,list-accounts.js,list-apps.js,list-execution-events.js,list-executions.js,list-function-invocations.js,list-functions.js,list-integrations.js,list-provider-models.js,list-tables.js,list-triggers.js,list-whatsapp-phone-numbers.js,list-workflows.js,openapi-explore.mjs,query-rows.js,reload-props.js,resume-execution.js,search-actions.js,update-execution-status.js,update-function.js,update-graph.js,update-integration.js,update-row.js,update-trigger.js,update-workflow-settings.js,upsert-row.js,validate-graph.js,variables-delete.js,variables-list.js,variables-set.js}
|scripts/lib/databases:{args.js,filters.js,kapso-api.js}
|scripts/lib/functions:{args.js,kapso-api.js}
|scripts/lib/workflows:{args.js,kapso-api.js,result.js}