agent-zero/plugins/_whatsapp_integration
Alessandro e2c5f59754 fix integration config UI persistence for Telegram + WhatsApp
Align integration config UX/saving behavior and project binding.

- Telegram integration: keep Save available when appropriate in the wizard footer
  so config changes (including deleting bots) can be persisted reliably.
- WhatsApp integration: fix project dropdown binding by using normalized
  key/value helpers (supports both `key/label` and `name/title` payloads) and
  showing project labels correctly.
- Mirror both fixes into the runtime plugin copy under agentdocker so the
  running container gets the update immediately.

This resolves user-reported integration setup issues and restores expected
save/delete behavior.
2026-04-21 06:01:36 +02:00
..
api ui: redesign email, Telegram, and WhatsApp settings 2026-04-11 01:40:24 +02:00
extensions/python Squashed commit of the following: 2026-03-31 09:47:25 +02:00
helpers integrations: add native chat controls and email config presets 2026-04-11 18:49:13 +02:00
prompts Squashed commit of the following: 2026-03-31 09:47:25 +02:00
webui fix integration config UI persistence for Telegram + WhatsApp 2026-04-21 06:01:36 +02:00
whatsapp-bridge Squashed commit of the following: 2026-03-31 09:47:25 +02:00
default_config.yaml Squashed commit of the following: 2026-03-31 09:47:25 +02:00
plugin.yaml Squashed commit of the following: 2026-03-31 09:47:25 +02:00
README.md integrations: add native chat controls and email config presets 2026-04-11 18:49:13 +02:00

WhatsApp Integration Plugin

Communicate with Agent Zero via WhatsApp using a Baileys-based Node.js bridge.

Requirements

  • Node.js (v18+) and npm installed on the system
  • A WhatsApp account on a phone (for QR code pairing)

Setup

Install bridge dependencies

cd plugins/_whatsapp_integration/whatsapp-bridge
npm install --production

Dependencies are auto-installed on first bridge start if missing.

Configure and pair

  1. Enable the plugin in Settings > External > WhatsApp Integration
  2. Configure allowed phone numbers
  3. Click Show QR Code and scan with WhatsApp on your phone
  4. Send a message from an allowed number to start a chat
  5. Use /project <name>, /config <preset>, or /send in WhatsApp to control the active chat directly

The WhatsApp session persists across restarts in tmp/whatsapp/session/. No re-pairing needed unless you disconnect via settings. Be careful: if you use your personal number and leave allowed_numbers open, other people could misuse your Agent Zero.

Configuration

Setting Description Default
enabled Enable bridge and polling false
mode self-chat (personal number) or dedicated (separate number) self-chat
allow_group Respond in group chats when mentioned or replied to false
bridge_port Local HTTP port for bridge 3100
poll_interval_seconds Poll frequency (min 2) 3
allowed_numbers Phone numbers without + prefix [] (all)
project Activate project for WA chats ""
agent_instructions Extra agent instructions ""

How It Works

  1. The bridge connects to WhatsApp via Baileys and exposes HTTP endpoints on localhost
  2. In personal-number mode, you can message your own WhatsApp number to talk to the agent, and the agent can also handle messages that other people send to that number
  3. The plugin polls the bridge for new messages every few seconds
  4. Incoming messages are routed to existing chats by WhatsApp chat ID or new chats are created
  5. Agent responses are sent back via the bridge as WhatsApp messages
  6. Media (images, documents) is supported in both directions

Architecture

WhatsApp Phone
    ↕ (WhatsApp protocol via Baileys)
whatsapp-bridge/bridge.js  (Node.js subprocess)
    ↕ (HTTP API on localhost)
Python helpers (wa_client, handler, bridge_manager)
    ↕ (Framework extensions)
Agent Zero