{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/automate-whatsapp",
  "version": "1.0.0",
  "name": "Automate Whatsapp",
  "description": "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...",
  "system_prompt_fragment": "# Automate WhatsApp\n\n## When to use\n\nUse this skill to build and run WhatsApp automations: workflow CRUD, graph edits, triggers, executions, function management, app integrations, and D1 database operations.\n\n## Setup\n\nEnv vars:\n- `KAPSO_API_BASE_URL` (host only, no `/platform/v1`)\n- `KAPSO_API_KEY`\n\n## How to\n\n### Edit a workflow graph\n\n1. Fetch graph: `node scripts/get-graph.js <workflow_id>` (note the `lock_version`)\n2. Edit the JSON (see graph rules below)\n3. Validate: `node scripts/validate-graph.js --definition-file <path>`\n4. Update: `node scripts/update-graph.js <workflow_id> --expected-lock-version <n> --definition-file <path>`\n5. Re-fetch to confirm\n\nFor small edits, use `edit-graph.js` with `--old-file` and `--new-file` instead.\n\nIf you get a lock_version conflict: re-fetch, re-apply changes, retry with new lock_version.\n\n### Manage triggers\n\n1. List: `node scripts/list-triggers.js <workflow_id>`\n2. Create: `node scripts/create-trigger.js <workflow_id> --trigger-type <type> --phone-number-id <id>`\n3. Toggle: `node scripts/update-trigger.js --trigger-id <id> --active true|false`\n4. Delete: `node scripts/delete-trigger.js --trigger-id <id>`\n\nFor inbound_message triggers, first run `node scripts/list-whatsapp-phone-numbers.js` to get `phone_number_id`.\n\n### Debug executions\n\n1. List: `node scripts/list-executions.js <workflow_id>`\n2. Inspect: `node scripts/get-execution.js <execution-id>`\n3. Get value: `node scripts/get-context-value.js <execution-id> --variable-path vars.foo`\n4. Events: `node scripts/list-execution-events.js <execution-id>`\n\n### Create and deploy a function\n\n1. Write code with handler signature (see function rules below)\n2. Create: `node scripts/create-function.js --name <name> --code-file <path>`\n3. Deploy: `node scripts/deploy-function.js --function-id <id>`\n4. Verify: `node scripts/get-function.js --function-id <id>`\n\n### Set up agent node with app integrations\n\n1. Find model: `node scripts/list-provider-models.js`\n2. Find account: `node scripts/list-accounts.js --app-slug <slug>` (use `pipedream_account_id`)\n3. Find action: `node scripts/search-actions.js --query <word> --app-slug <slug>` (action_id = key)\n4. Create integration: `node scripts/create-integration.js --action-id <id> --app-slug <slug> --account-id <id> --configured-props <json>`\n5. Add tools to agent node via `flow_agent_app_integration_tools`\n\n### Database CRUD\n\n1. List tables: `node scripts/list-tables.js`\n2. Query: `node scripts/query-rows.js --table <name> --filters <json>`\n3. Create/update/delete with row scripts\n\n## Graph rules\n\n- Exactly one start node with `id` = `start`\n- Never change existing node IDs\n- Use `{node_type}_{timestamp_ms}` for new node IDs\n- Non-decide nodes have 0 or 1 outgoing `next` edge\n- Decide edge labels must match `conditions[].label`\n- Edge keys are `source`/`target`/`label` (not `from`/`to`)\n\nFor full schema details, see `references/graph-contract.md`.\n\n## Function rules\n\n```js\nasync function handler(request, env) {\n  // Parse input\n  const body = await request.json();\n  // Use env.KV and env.DB as needed\n  return new Response(JSON.stringify({ result: \"ok\" }));\n}\n```\n\n- Do NOT use `export`, `export default`, or arrow functions\n- Return a `Response` object\n\n## Execution context\n\nAlways use this structure:\n- `vars` - user-defined variables\n- `system` - system variables\n- `context` - channel data\n- `metadata` - request metadata\n\n## Scripts\n\n### Workflows\n\n| Script | Purpose |\n|--------|---------|\n| `list-workflows.js` | List workflows (metadata only) |\n| `get-workflow.js` | Get workflow metadata |\n| `create-workflow.js` | Create a workflow |\n| `update-workflow-settings.js` | Update workflow settings |\n\n### Graph\n\n| Script | Purpose |\n|--------|---------|\n| `get-graph.js` | Get workflow graph + lock_version |\n| `edit-graph.js` | Patch graph via string replacement |\n| `update-graph.js` | Replace entire graph |\n| `validate-graph.js` | Validate graph structure locally |\n\n### Triggers\n\n| Script | Purpose |\n|--------|---------|\n| `list-triggers.js` | List triggers for a workflow |\n| `create-trigger.js` | Create a trigger |\n| `update-trigger.js` | Enable/disable a trigger |\n| `delete-trigger.js` | Delete a trigger |\n| `list-whatsapp-phone-numbers.js` | List phone numbers for trigger setup |\n\n### Executions\n\n| Script | Purpose |\n|--------|---------|\n| `list-executions.js` | List executions |\n| `get-execution.js` | Get execution details |\n| `get-context-value.js` | Read value from execution context |\n| `update-execution-status.js` | Force execution state |\n| `resume-execution.js` | Resume waiting execution |\n| `list-execution-events.js` | List execution events |\n\n### Functions\n\n| Script | Purpose |\n|--------|---------|\n| `list-functions.js` | List project functions |\n| `get-function.js` | Get function details + code |\n| `create-function.js` | Create a function |\n| `update-function.js` | Update function code |\n| `deploy-function.js` | Deploy function to runtime |\n| `invoke-function.js` | Invoke function with payload |\n| `list-function-invocations.js` | List function invocations |\n\n### App integrations\n\n| Script | Purpose |\n|--------|---------|\n| `list-apps.js` | Search integration apps |\n| `search-actions.js` | Search actions (action_id = key) |\n| `get-action-schema.js` | Get action JSON schema |\n| `list-accounts.js` | List connected accounts |\n| `create-connect-token.js` | Create OAuth connect link |\n| `configure-prop.js` | Resolve remote_options for a prop |\n| `reload-props.js` | Reload dynamic props |\n| `list-integrations.js` | List saved integrations |\n| `create-integration.js` | Create an integration |\n| `update-integration.js` | Update an integration |\n| `delete-integration.js` | Delete an integration |\n\n### Databases\n\n| Script | Purpose |\n|--------|---------|\n| `list-tables.js` | List D1 tables |\n| `get-table.js` | Get table schema + sample rows |\n| `query-rows.js` | Query rows with filters |\n| `create-row.js` | Create a row |\n| `update-row.js` | Update rows |\n| `upsert-row.js` | Upsert a row |\n| `delete-row.js` | Delete rows |\n\n### OpenAPI\n\n| Script | Purpose |\n|--------|---------|\n| `openapi-explore.mjs` | Explore OpenAPI (search/op/schema/where) |\n\nInstall deps (once):\n```bash\nnpm i\n```\n\nExamples:\n```bash\nnode scripts/openapi-explore.mjs --spec workflows search \"variables\"\nnode scripts/openapi-explore.mjs --spec workflows op getWorkflowVariables\nnode scripts/openapi-explore.mjs --spec platform op queryDatabaseRows\n```\n\n## Notes\n\n- Prefer file paths over inline JSON (`--definition-file`, `--code-file`)\n- `action_id` is the same as `key` from `search-actions`\n- `--account-id` uses `pipedream_account_id` from `list-accounts`\n- Variable CRUD (`variables-set.js`, `variables-delete.js`) is blocked - Platform API doesn't support it\n- Raw SQL execution is not supported via Platform API\n\n## References\n\nRead before editing:\n- references/graph-contract.md - Graph schema, computed vs editable fields, lock_version\n- references/node-types.md - Node types and config shapes\n- references/workflow-overview.md - Execution flow and states\n\nOther references:\n- references/execution-context.md - Context structure and variable substitution\n- references/triggers.md - Trigger types and setup\n- references/app-integrations.md - App integration and variable_definitions\n- references/functions-reference.md - Function management\n- references/functions-payloads.md - Payload shapes for functions\n- references/databases-reference.md - Database operations\n\n## Assets\n\n| File | Description |\n|------|-------------|\n| `workflow-linear.json` | Minimal linear workflow |\n| `workflow-decision.json` | Minimal branching workflow |\n| `workflow-agent-simple.json` | Minimal agent workflow |\n| `workflow-customer-support-intake-agent.json` | Customer support intake |\n| `workflow-interactive-buttons-decide-function.json` | Interactive buttons + decide (function) |\n| `workflow-interactive-buttons-decide-ai.json` | Interactive buttons + decide (AI) |\n| `workflow-api-template-wait-agent.json` | API trigger + template + agent |\n| `function-decide-route-interactive-buttons.json` | Function for button routing |\n| `agent-app-integration-example.json` | Agent node with app integrations |\n\n## Related skills\n\n- `integrate-whatsapp` - Onboarding, webhooks, messaging, templates, flows\n- `observe-whatsapp` - Debugging, logs, health checks\n\n<!-- FILEMAP:BEGIN -->\n```text\n[automate-whatsapp file map]|root: .\n|.:{package.json,SKILL.md}\n|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}\n|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}\n|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}\n|scripts/lib/databases:{args.js,filters.js,kapso-api.js}\n|scripts/lib/functions:{args.js,kapso-api.js}\n|scripts/lib/workflows:{args.js,kapso-api.js,result.js}\n```\n<!-- FILEMAP:END -->",
  "applicable_domains": [
    "other"
  ],
  "category": "other",
  "invocation": [
    "/automate-whatsapp"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/automate-whatsapp",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/automate-whatsapp",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists. Upstream as recorded by the aggregator: https://github.com/gokapso/agent-skills/tree/master/skills/automate-whatsapp."
  },
  "tags": [
    "claudeskills",
    "other",
    "risk-reviewed"
  ],
  "lifecycle": "draft"
}