> ## 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 WhatsApp message failed

> Start an automation when WhatsApp cannot deliver a message.

`onWhatsAppMessageFailed` starts an automation when WhatsApp reports a failed message delivery.

```ts automations/handle-whatsapp-failures.automation.ts theme={null}
import { automation } from "automate.ax"
import { onWhatsAppMessageFailed } from "automate.ax/whatsapp"

export default automation("Handle WhatsApp failures", () => {
  const event = onWhatsAppMessageFailed()
  event.errors
})
```

Optional static `account` defaults to the project's WhatsApp binding. The signal has `status: "failed"` and includes the message and recipient IDs, timestamp, callback data, conversation, pricing, structured Meta errors, and `providerEvent` described by [the broad status trigger](/reference/integrations/whatsapp/triggers/on-message-status-event).

Inspect `errors` for the provider code, message, details, subcode, and trace ID before deciding whether to retry or correct the recipient or template.
