Whapi.Cloud plugins for Dify workflows and AI agents, using the Whapi.Cloud WhatsApp API. Connect your number by scanning a QR code in the Whapi Panel — the same linked-device pairing flow you already use for WhatsApp Web.
This monorepo ships two plugins for a full WhatsApp loop on Dify:
| Package | Role | Documentation |
|---|---|---|
whapi-tool/ |
Outbound tools: common sends/checks plus Custom API Request for any documented endpoint | whapi-tool/README.md |
whapi-trigger/ |
Inbound triggers: message and group webhook events (registers callback on your channel) | whapi-trigger/README.md |
Repository: https://github.com/Whapi-Cloud/dify-whapi
Typical WhatsApp auto-reply or agent flow:
- Whapi Trigger receives a webhook from your Whapi channel and starts a Dify workflow.
- Your workflow (LLM, logic, knowledge) builds a reply.
- Whapi Tool sends the response back through the Whapi API.
You can install only the tool plugin if you only need outbound sends from Dify. Install both when Dify must react to incoming messages or group events.
flowchart LR
WA[WhatsApp user] --> WH[Whapi.Cloud channel]
WH -->|webhook| TR[Whapi Trigger plugin]
TR --> DF[Dify workflow]
DF --> TL[Whapi Tool plugin]
TL -->|HTTPS API| WH
WH --> WA
- Triggers: new and updated messages; group membership and group-related events (see trigger README for payloads).
- Actions: send text and media; fetch a message by ID; check whether a phone number is on WhatsApp; any other Whapi API operation via Custom API Request (see below).
We ship dedicated tools for the operations most workflows need every day. The Whapi API has many more endpoints — we do not duplicate each one as a separate Dify tool. Custom API Request calls other documented endpoints on gate.whapi.cloud. Method and path are set in the workflow (not by the model); POST/PUT/PATCH/DELETE can change or delete channel data — see whapi-tool/README.md#custom-api-request-safety.
| Requirement | Tool plugin | Trigger plugin |
|---|---|---|
| Dify with Plugins enabled | Yes | Yes |
| Minimum Dify version | 1.0.0 (per manifest.yaml) |
1.10.0 (trigger subscriptions) |
| Whapi.Cloud account and paired channel | Yes | Yes |
| Channel access token from Whapi Panel | Yes | Yes |
| API host | https://gate.whapi.cloud only (fixed in code; not configurable) |
Same |
| Plugin runtime | Python 3.12, dify-plugin ≥ 0.9.0 |
Same |
Whapi plans, sandbox limits, and billing are described on whapi.cloud and in the API documentation. This integration does not change those limits.
Build or obtain .difypkg files (see Build packages) and upload them in Dify:
- Plugins → Install plugin → upload the package.
- Install Whapi Tool (
whapi-0.0.1.difypkgor current version fromwhapi-tool/manifest.yaml). - For inbound automation, also install Whapi Trigger (
whapi_trigger-0.0.1.difypkgor current version fromwhapi-trigger/manifest.yaml).
Then follow the plugin-specific guides:
- Tool: credentials + tools → whapi-tool/README.md
- Trigger: subscription + event families → whapi-trigger/README.md
On subscription save, the trigger plugin updates your channel webhook settings (PATCH /settings), merging with existing webhooks where possible.
For local iteration, use the Dify Plugin CLI (dify on PATH).
- Open
whapi-tool/orwhapi-trigger/. - Create a virtual environment and install dependencies.
- Copy
.env.example→.envand setREMOTE_INSTALL_URLandREMOTE_INSTALL_KEYfrom Dify → Plugins → Debug. - Run
python -m mainand attach the plugin from the Dify debug UI.
Windows (PowerShell):
cd whapi-tool # or whapi-trigger
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
Copy-Item .env.example .env
python -m mainmacOS / Linux:
cd whapi-tool # or whapi-trigger
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python -m mainFrom the repository root, with the Plugin CLI installed:
dify plugin package ./whapi-tool
dify plugin package ./whapi-triggerOutputs are .difypkg archives named from each plugin’s author, name, and version in manifest.yaml.
Before submitting to the Dify Marketplace, validate packages with the Dify Marketplace Toolkit (validate-difypkg.py). Marketplace submissions are one .difypkg per pull request to langgenius/dify-plugins; this repo intentionally publishes two plugins (tool vs trigger).
| Path | Purpose |
|---|---|
whapi-tool/ |
Tool plugin: README, PRIVACY.md, LICENSE (packaged) |
whapi-trigger/ |
Trigger plugin: README, PRIVACY.md, LICENSE (packaged) |
shared/whapi_client.py |
Shared HTTP client source of truth |
Each plugin ships a copy under whapi_lib/client.py inside its package. After editing shared/whapi_client.py, sync copies into both plugins before packaging.
Each plugin includes its own policy:
Whapi.Cloud platform policies: Privacy · Data Processing Agreement (PDF)
Traffic goes to https://gate.whapi.cloud (declared in each manifest.yaml under network.domains).
| Channel | Link |
|---|---|
| GitHub Issues | https://github.com/Whapi-Cloud/dify-whapi/issues |
| care@whapi.cloud | |
| Whapi API docs | https://whapi.cloud/docs |