Docs/Channels/WhatsApp
Channels

WhatsApp

Connect your agent to WhatsApp through a local Node.js bridge that speaks the WhatsApp Web protocol (`@whiskeysockets/baileys`). The Python adapter talks to the bridge over WebSocket; authentication is a QR-code scan handled by the bridge.

Requirements

  • Node.js β‰₯ 18 (the bridge is built and run from the CLI).
  • A phone with WhatsApp to scan the QR code.

Configuration

Set under channels.whatsapp in ~/.flowly/config.json:

{
  "channels": {
    "whatsapp": {
      "enabled": true,
      "bridgeUrl": "ws://localhost:3001",
      "allowFrom": []
    }
  }
}
KeyTypeDefaultDescription
enabledboolfalseStart the WhatsApp adapter at gateway boot.
bridgeUrlstringws://localhost:3001WebSocket URL of the Node bridge.
allowFromstring[][]Allowed phone numbers. Empty = allow all.
There is no token in config β€” WhatsApp auth is a QR-code scan performed by the bridge.

Connect method

The adapter connects to the bridge at bridgeUrl and exchanges JSON frames: inbound message frames are turned into agent messages, and it also handles status, qr, and error frames. Outbound replies are sent as {"type":"send","to":<chat_id>,"text":<content>}. The adapter reconnects on drop with a 5-second backoff. Access is enforced via allowFrom; the WhatsApp adapter does not use the pairing store.

Bridge setup and login

The bridge is provisioned, built, and run by the CLI:

flowly channels login
flowly channels status

flowly channels login builds the bridge if needed (npm install && npm run build) and runs it, printing a QR code to scan with WhatsApp on your phone. The bridge lives at ~/.flowly/bridge.

Note

flowly channels status shows WhatsApp's enabled state and bridge URL. channels status currently reports only WhatsApp.

Setup steps

  1. Ensure Node.js β‰₯ 18 is installed.
  2. Set channels.whatsapp.enabled to true.
  3. Run flowly channels login and scan the QR code with WhatsApp.
  4. Optionally restrict access via allowFrom.
  5. Start the gateway: flowly gateway (the bridge must be running for messages to flow).