jpskill.com
🛠️ 開発・MCP コミュニティ

automate-whatsapp

Build WhatsApp automations with Kapso workflows: configure WhatsApp triggers, edit workflow graphs, manage executions, deploy functions, and use databases/integrations for state. Use when automating WhatsApp conversations and event handling.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o automate-whatsapp.zip https://jpskill.com/download/19912.zip && unzip -o automate-whatsapp.zip && rm automate-whatsapp.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19912.zip -OutFile "$d\automate-whatsapp.zip"; Expand-Archive "$d\automate-whatsapp.zip" -DestinationPath $d -Force; ri "$d\automate-whatsapp.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して automate-whatsapp.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → automate-whatsapp フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

WhatsAppの自動化

使用する場面

このスキルは、WhatsAppの自動化を構築および実行するために使用します。具体的には、ワークフローのCRUD、グラフの編集、トリガー、実行、関数管理、アプリ連携、D1データベース操作などです。

セットアップ

環境変数:

  • KAPSO_API_BASE_URL (ホストのみ、/platform/v1は含めない)
  • KAPSO_API_KEY

使用方法

ワークフローグラフの編集

  1. グラフの取得: node scripts/get-graph.js <workflow_id> (lock_versionに注意してください)
  2. JSONを編集します(下記のグラフルールを参照してください)
  3. 検証: node scripts/validate-graph.js --definition-file <path>
  4. 更新: node scripts/update-graph.js <workflow_id> --expected-lock-version <n> --definition-file <path>
  5. 再度取得して確認します

小さな編集の場合は、代わりにedit-graph.js--old-file--new-fileとともに使用してください。

lock_versionの競合が発生した場合は、再度取得し、変更を再適用し、新しいlock_versionで再試行してください。

トリガーの管理

  1. 一覧表示: node scripts/list-triggers.js <workflow_id>
  2. 作成: node scripts/create-trigger.js <workflow_id> --trigger-type <type> --phone-number-id <id>
  3. 切り替え: node scripts/update-trigger.js --trigger-id <id> --active true|false
  4. 削除: node scripts/delete-trigger.js --trigger-id <id>

inbound_messageトリガーの場合、まずnode scripts/list-whatsapp-phone-numbers.jsを実行してphone_number_idを取得してください。

実行のデバッグ

  1. 一覧表示: node scripts/list-executions.js <workflow_id>
  2. 検査: node scripts/get-execution.js <execution-id>
  3. 値の取得: node scripts/get-context-value.js <execution-id> --variable-path vars.foo
  4. イベント: node scripts/list-execution-events.js <execution-id>

関数の作成とデプロイ

  1. ハンドラシグネチャを持つコードを記述します(下記の関数ルールを参照してください)
  2. 作成: node scripts/create-function.js --name <name> --code-file <path>
  3. デプロイ: node scripts/deploy-function.js --function-id <id>
  4. 検証: node scripts/get-function.js --function-id <id>

アプリ連携によるエージェントノードの設定

  1. モデルの検索: node scripts/list-provider-models.js
  2. アカウントの検索: node scripts/list-accounts.js --app-slug <slug> (pipedream_account_idを使用してください)
  3. アクションの検索: node scripts/search-actions.js --query <word> --app-slug <slug> (action_id = key)
  4. 連携の作成: node scripts/create-integration.js --action-id <id> --app-slug <slug> --account-id <id> --configured-props <json>
  5. flow_agent_app_integration_toolsを介してエージェントノードにツールを追加します

データベースのCRUD

  1. テーブルの一覧表示: node scripts/list-tables.js
  2. クエリ: node scripts/query-rows.js --table <name> --filters <json>
  3. 行スクリプトで作成/更新/削除します

グラフルール

  • idstartである開始ノードが正確に1つ存在します
  • 既存のノードIDは決して変更しないでください
  • 新しいノードIDには{node_type}_{timestamp_ms}を使用してください
  • 非決定ノードには0または1つの出力nextエッジがあります
  • 決定エッジラベルはconditions[].labelと一致する必要があります
  • エッジキーはsource/target/labelです(from/toではありません)

完全なスキーマの詳細は、references/graph-contract.mdを参照してください。

関数ルール

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" }));
}
  • exportexport default、またはアロー関数は使用しないでください
  • Responseオブジェクトを返してください

実行コンテキスト

常にこの構造を使用してください:

  • vars - ユーザー定義変数
  • system - システム変数
  • context - チャネルデータ
  • metadata - リクエストメタデータ

スクリプト

ワークフロー

スクリプト 目的
list-workflows.js ワークフローを一覧表示します(メタデータのみ)
get-workflow.js ワークフローのメタデータを取得します
create-workflow.js ワークフローを作成します
update-workflow-settings.js ワークフローの設定を更新します

グラフ

スクリプト 目的
get-graph.js ワークフローグラフとlock_versionを取得します
edit-graph.js 文字列置換によりグラフをパッチ適用します
update-graph.js グラフ全体を置き換えます
validate-graph.js グラフ構造をローカルで検証します

トリガー

スクリプト 目的
list-triggers.js ワークフローのトリガーを一覧表示します
create-trigger.js トリガーを作成します
update-trigger.js トリガーを有効/無効にします
delete-trigger.js トリガーを削除します
list-whatsapp-phone-numbers.js トリガー設定用の電話番号を一覧表示します

実行

スクリプト 目的
list-executions.js 実行を一覧表示します
get-execution.js 実行の詳細を取得します
get-context-value.js 実行コンテキストから値を読み取ります
update-execution-status.js 実行状態を強制します
resume-execution.js 待機中の実行を再開します
list-execution-events.js 実行イベントを一覧表示します

関数

スクリプト 目的
list-functions.js プロジェクト関数を一覧表示します
get-function.js 関数の詳細とコードを取得します
create-function.js 関数を作成します
update-function.js 関数コードを更新します
deploy-function.js 関数をランタイムにデプロイします
invoke-function.js ペイロードで関数を呼び出します
list-function-invocations.js 関数の呼び出しを一覧表示します

アプリ連携

スクリプト 目的
list-apps.js 連携アプリを検索します
search-actions.js アクションを検索します (action_id = key)
get-action-schema.js アクションのJSONスキーマを取得します
list-accounts.js 接続済みアカウントを一覧表示します
create-connect-token.js OAuth接続リンクを作成します
configure-prop.js プロパティのremote_optionsを解決します
reload-props.js 動的プロパティをリロードします
list-integrations.js 保存された連携を一覧表示します
create-integration.js 連携を作成します
update-integration.js 連携を更新します
delete-integration.js 連携を削除します

データベース

スクリプト 目的
list-tables.js D1テーブルを一覧表示します
get-table.js テーブルスキーマとサンプル行を取得します
query-rows.js フィルターで行をクエリします
create-row.js 行を作成します
update-row.js 行を更新します
upse
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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:

  • KAPSO_API_BASE_URL (host only, no /platform/v1)
  • KAPSO_API_KEY

How to

Edit a workflow graph

  1. Fetch graph: node scripts/get-graph.js <workflow_id> (note the lock_version)
  2. Edit the JSON (see graph rules below)
  3. Validate: node scripts/validate-graph.js --definition-file <path>
  4. Update: node scripts/update-graph.js <workflow_id> --expected-lock-version <n> --definition-file <path>
  5. 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

  1. List: node scripts/list-triggers.js <workflow_id>
  2. Create: node scripts/create-trigger.js <workflow_id> --trigger-type <type> --phone-number-id <id>
  3. Toggle: node scripts/update-trigger.js --trigger-id <id> --active true|false
  4. Delete: node scripts/delete-trigger.js --trigger-id <id>

For inbound_message triggers, first run node scripts/list-whatsapp-phone-numbers.js to get phone_number_id.

Debug executions

  1. List: node scripts/list-executions.js <workflow_id>
  2. Inspect: node scripts/get-execution.js <execution-id>
  3. Get value: node scripts/get-context-value.js <execution-id> --variable-path vars.foo
  4. Events: node scripts/list-execution-events.js <execution-id>

Create and deploy a function

  1. Write code with handler signature (see function rules below)
  2. Create: node scripts/create-function.js --name <name> --code-file <path>
  3. Deploy: node scripts/deploy-function.js --function-id <id>
  4. Verify: node scripts/get-function.js --function-id <id>

Set up agent node with app integrations

  1. Find model: node scripts/list-provider-models.js
  2. Find account: node scripts/list-accounts.js --app-slug <slug> (use pipedream_account_id)
  3. Find action: node scripts/search-actions.js --query <word> --app-slug <slug> (action_id = key)
  4. Create integration: node scripts/create-integration.js --action-id <id> --app-slug <slug> --account-id <id> --configured-props <json>
  5. Add tools to agent node via flow_agent_app_integration_tools

Database CRUD

  1. List tables: node scripts/list-tables.js
  2. Query: node scripts/query-rows.js --table <name> --filters <json>
  3. Create/update/delete with row scripts

Graph rules

  • Exactly one start node with id = start
  • Never change existing node IDs
  • Use {node_type}_{timestamp_ms} for new node IDs
  • Non-decide nodes have 0 or 1 outgoing next edge
  • Decide edge labels must match conditions[].label
  • Edge keys are source/target/label (not from/to)

For full schema details, see references/graph-contract.md.

Function rules

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, export default, or arrow functions
  • Return a Response object

Execution context

Always use this structure:

  • vars - user-defined variables
  • system - system variables
  • context - channel data
  • metadata - request metadata

Scripts

Workflows

Script Purpose
list-workflows.js List workflows (metadata only)
get-workflow.js Get workflow metadata
create-workflow.js Create a workflow
update-workflow-settings.js Update workflow settings

Graph

Script Purpose
get-graph.js Get workflow graph + lock_version
edit-graph.js Patch graph via string replacement
update-graph.js Replace entire graph
validate-graph.js Validate graph structure locally

Triggers

Script Purpose
list-triggers.js List triggers for a workflow
create-trigger.js Create a trigger
update-trigger.js Enable/disable a trigger
delete-trigger.js Delete a trigger
list-whatsapp-phone-numbers.js List phone numbers for trigger setup

Executions

Script Purpose
list-executions.js List executions
get-execution.js Get execution details
get-context-value.js Read value from execution context
update-execution-status.js Force execution state
resume-execution.js Resume waiting execution
list-execution-events.js List execution events

Functions

Script Purpose
list-functions.js List project functions
get-function.js Get function details + code
create-function.js Create a function
update-function.js Update function code
deploy-function.js Deploy function to runtime
invoke-function.js Invoke function with payload
list-function-invocations.js List function invocations

App integrations

Script Purpose
list-apps.js Search integration apps
search-actions.js Search actions (action_id = key)
get-action-schema.js Get action JSON schema
list-accounts.js List connected accounts
create-connect-token.js Create OAuth connect link
configure-prop.js Resolve remote_options for a prop
reload-props.js Reload dynamic props
list-integrations.js List saved integrations
create-integration.js Create an integration
update-integration.js Update an integration
delete-integration.js Delete an integration

Databases

Script Purpose
list-tables.js List D1 tables
get-table.js Get table schema + sample rows
query-rows.js Query rows with filters
create-row.js Create a row
update-row.js Update rows
upsert-row.js Upsert a row
delete-row.js Delete rows

OpenAPI

Script Purpose
openapi-explore.mjs Explore OpenAPI (search/op/schema/where)

Install deps (once):

npm i

Examples:

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 queryDatabaseRows

Notes

  • Prefer file paths over inline JSON (--definition-file, --code-file)
  • action_id is the same as key from search-actions
  • --account-id uses pipedream_account_id from list-accounts
  • Variable CRUD (variables-set.js, variables-delete.js) is blocked - Platform API doesn't support it
  • Raw SQL execution is not supported via Platform API

References

Read before editing:

Other references:

Assets

File Description
workflow-linear.json Minimal linear workflow
workflow-decision.json Minimal branching workflow
workflow-agent-simple.json Minimal agent workflow
workflow-customer-support-intake-agent.json Customer support intake
workflow-interactive-buttons-decide-function.json Interactive buttons + decide (function)
workflow-interactive-buttons-decide-ai.json Interactive buttons + decide (AI)
workflow-api-template-wait-agent.json API trigger + template + agent
function-decide-route-interactive-buttons.json Function for button routing
agent-app-integration-example.json Agent node with app integrations

Related skills

  • integrate-whatsapp - Onboarding, webhooks, messaging, templates, flows
  • observe-whatsapp - Debugging, logs, health checks

<!-- FILEMAP:BEGIN -->

[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}

<!-- FILEMAP:END -->