kdeps-listeners-whatsapp_webhook
v1.0.0WhatsApp Cloud API webhook on /whatsapp: answers the Meta verification handshake and runs the workflow once for each signed notification. The event is the notification: input('entry')[0].changes[0].value.messages[0]. Status callbacks (sent, delivered, read) get 200 and start no run. Reply with the whatsapp_post component. Needs WHATSAPP_VERIFY_TOKEN and WHATSAPP_APP_SECRET.
set listeners / shelf workflow
LLM context: none - kdeps uses it without sending it to the model
Where it runs
Part of the listeners set, used in workflow and agent mode. Ready-made event sources for deploy.input.listen: a Telegram poll, Slack Socket Mode and the Discord Gateway, each one transport block in YAML.
- a workflow names a listener under deploy.input.listen
- the listener is read from the listeners set when kdeps run startslisteners/whatsapp_webhook
- its transport (poll, websocket, ...) starts
- each event runs the workflow once
Loaded by: kdeps (agent loop), kdeps run, kdeps exec
In the code: kdeps (agent loop)listen.WakeAddrslisten.readListenerAsset
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Pin a version with kdeps install listeners/whatsapp_webhook@<version>.
Contents
WhatsApp Cloud API webhook on /whatsapp: answers the Meta verification handshake and runs the workflow once for each signed notification. The event is the notification: input('entry')[0].changes[0].value.messages[0]. Status callbacks (sent, delivered, read) get 200 and start no run. Reply with the whatsapp_post component. Needs WHATSAPP_VERIFY_TOKEN and WHATSAPP_APP_SECRET.
- kdeps
- >=3.6.0
webhook:
path: /whatsapp
env:
VERIFY_TOKEN:
- WHATSAPP_VERIFY_TOKEN
- secret:whatsapp_verify_token
handshake: '{{if and (eq .method "GET") (eq (index .query "hub.mode")
"subscribe") (eq (index .query "hub.verify_token") .env.VERIFY_TOKEN)}}{{int
(index .query "hub.challenge")}}{{end}}'
when: '{{if get .event "entry" 0 "changes" 0 "value" "messages"}}true{{end}}'
verify:
secret:
- WHATSAPP_APP_SECRET
- secret:whatsapp_app_secret
signature: '{{trimPrefix (index .headers "X-Hub-Signature-256") "sha256="}}'
version: 1.0.0
kdeps: ">=3.6.0"
description: 'WhatsApp Cloud API webhook on /whatsapp: answers the Meta verification handshake and runs the workflow once for each signed notification. The event is the notification: input(''entry'')[0].changes[0].value.messages[0]. Status callbacks (sent, delivered, read) get 200 and start no run. Reply with the whatsapp_post component. Needs WHATSAPP_VERIFY_TOKEN and WHATSAPP_APP_SECRET.'
webhook:
path: /whatsapp
env:
VERIFY_TOKEN: [WHATSAPP_VERIFY_TOKEN, "secret:whatsapp_verify_token"]
# Meta's GET check: echo hub.challenge (a number) when the verify token matches.
handshake: '{{if and (eq .method "GET") (eq (index .query "hub.mode") "subscribe") (eq (index .query "hub.verify_token") .env.VERIFY_TOKEN)}}{{int (index .query "hub.challenge")}}{{end}}'
# Only notifications with messages run; status callbacks (sent, delivered, read) get 200.
when: '{{if get .event "entry" 0 "changes" 0 "value" "messages"}}true{{end}}'
# Meta signs each POST body with the app secret: X-Hub-Signature-256: sha256=<hex>.
verify:
secret: [WHATSAPP_APP_SECRET, "secret:whatsapp_app_secret"]
signature: '{{trimPrefix (index .headers "X-Hub-Signature-256") "sha256="}}'
Versions
| Version | Published | Status | Source |
|---|---|---|---|
| 1.0.0 | 11/27/2026 | active | GitHub v1.0.0 |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.0.0
- Published
- 11/27/2026