> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# On message received

> Start an automation when a WhatsApp Business phone number receives a message.

`onWhatsAppMessageReceived` subscribes the connected WhatsApp Business Account and receives messages for its selected phone number.

```ts automations/watch-whatsapp.automation.ts theme={null}
import { automation } from "automate.ax"
import { onWhatsAppMessageReceived } from "automate.ax/whatsapp"

export default automation("Watch WhatsApp", () => {
  const received = onWhatsAppMessageReceived()

  received.message.type
  received.sender.id
})
```

It accepts optional static `account`, defaulting to the project binding. A signal cannot choose the phone number at runtime.

The signal includes `businessAccountId`, `phoneNumberId`, `displayPhoneNumber`, sender ID and profile name, message ID, timestamp, type, typed content, reply context, and `providerEvent`. Supported message types include text, media, location, contacts, buttons, interactive replies, reactions, orders, system events, and unsupported payloads.

Meta retries failed deliveries. Automate.ax verifies the `X-Hub-Signature-256` signature and deduplicates messages by provider message ID before orchestration.
