by langgenius · v0.0.6
A WhatsApp extension that sends and receives WhatsApp messages
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Author: langgenius Version: 0.0.1 Type: extension
WhatsApp Cloud API extension that receives messages via webhook and optionally forwards them to a selected Dify App to generate replies, then sends responses back to WhatsApp users.
uv sync --project . --no-dev
uv run --project . python -m main
Open plugin settings and fill:
WhatsApp Access Token (access_token): from Meta for Developers.Webhook Verify Token (verify_token): choose a secret and reuse in Meta webhook setup.Phone Number ID (phone_number_id): WhatsApp Business phone number ID.WhatsApp Business Account ID (waba_id): WABA ID, required for fetching approved templates.Dify App (app): optional. If set, incoming user text can be forwarded to the app; otherwise the plugin echoes the text.This plugin provides the following WhatsApp tools:
send_message)Send a plain text message to a WhatsApp user.
Parameters:
to: WhatsApp user ID or phone number (international format without +)text: Message content to sendsend_template)Send an approved WhatsApp template message to a user. This tool dynamically fetches your approved templates from WhatsApp Business.
Parameters:
to: WhatsApp user ID or phone number (international format without +)template_name: Enter the template you would like to send as a string. The template has to be approved by Meta.language_code: Template language code (e.g., en_US, zh_CN, pt_BR). Default: en_UStemplate_parameters: Optional parameters for template variables (comma-separated or JSON array)Example template parameters:
"John,123" (for templates with {{1}}, {{2}})[{"type":"text","text":"John"},{"type":"text","text":"123"}]GET /webhooks/whatsapp for webhook verification: responds with hub.challenge when hub.verify_token matches settings.POST /webhooks/whatsapp to receive events. Currently extracts text messages and replies with text.Apply for a Meta Developer account
https://developers.facebook.com/ and create/upgrade to a Developer account.Create a WhatsApp app in Meta for Developers
https://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-whatsapp-echo-bot.Generate API token and copy Phone Number ID
In WhatsApp > API Setup, generate an access token (temporary test token or system user token) and copy your Phone Number ID.
You will need these values in Dify plugin settings: WhatsApp Access Token and Phone Number ID.
Reference:
3.5. Find your WhatsApp Business Account ID (WABA ID)
123456789012345) that identifies your WhatsApp Business Account.https://graph.facebook.com/v24.0/me/businesses?access_token=YOUR_TOKENsend_template tool to fetch your approved message templates.Configure the webhook in Meta to point to this plugin
In WhatsApp > Configuration, set:
https://<your-dify-host>/webhooks/whatsappWebhook Verify Token you set in the plugin settings.Subscribe to the messages field for the Webhook.
References:
Token hygiene for testing accounts
Helpful docs:
messages[].from): https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/payload-exampleshttps://developers.facebook.com/docs/whatsapp/cloud-api/guides/set-up-whatsapp-echo-botTo have the Chatflow identify user from webhook, you will need to set up a few optional fields in your Chatflow's Start node.
After setting up API keys, add the following inputs in your Chatflow App's start node:
You may use either for the To field in send_message tool. Include both to act as fallback for payload inconsistency.
Note: since all templates need to be approved by Meta, the send_template tool acts as a functional node most suitable for Workflow, rather than Chatflow.