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

# WhatsApp Flow

> How inbound WhatsApp messages are matched to sessions — delivery path, reply format, interactive messages, and cross-session memory.

Use **[Create WhatsApp Agent](/whatsapp/connect-whatsapp)** first if you have not connected your account yet. For diagnosing issues, see **[Troubleshooting](/whatsapp/troubleshooting)**. For reply window and template rules, see **[Messaging Rules](/whatsapp/whatsapp-rules)**.

<Tip>
  **WhatsApp Flow** covers how **OpenCX** processes messages after go-live. Setup steps stay on [Create WhatsApp Agent](/whatsapp/connect-whatsapp).
</Tip>

## Path Of A Message

```mermaid theme={"dark"}
flowchart LR
  A([Customer]) --> B[WhatsApp]
  B --> C[Webhook]
  C --> D[Match number]
  D --> E[Session]
  E --> F[AI reply]
  F --> G([Customer])

  style A fill:#1a5c20,color:#fff,stroke:#267a2e
  style G fill:#1a5c20,color:#fff,stroke:#267a2e
```

<Steps>
  <Step title="Customer Sends A Message">
    The customer messages your WhatsApp business number. Text, images, video, documents, voice notes, and location pins are all supported.
  </Step>

  <Step title="Message Delivered To OpenCX">
    The message arrives via webhook and is validated.
  </Step>

  <Step title="Match Number To Org">
    **OpenCX** matches the receiving business number to your org.
  </Step>

  <Step title="Find Or Create Session">
    The sender's phone number is matched against existing contacts. If a contact has an **open WhatsApp session** on this business number, the message continues it. Otherwise a new session is created. If no contact record exists, a new contact is created automatically.
  </Step>

  <Step title="AI Generates Reply">
    If <Tooltip tip="Controls which conversations the AI auto-replies to. Configure per channel under Settings." cta="Autopilot settings" href="https://platform.open.cx/settings/autopilot">**Autopilot**</Tooltip> is enabled and the per-number AI toggle is on, the AI generates a reply after a <Tooltip tip="A brief pause before the AI responds, allowing the customer to finish typing multiple messages.">short delay</Tooltip>. When Autopilot is off or the session is handed off, human agents reply from the [inbox](https://platform.open.cx/inbox) instead.
  </Step>
</Steps>

<Note>
  The thread in your [OpenCX dashboard](https://platform.open.cx) is the authoritative record. Session continuity is by **customer phone number** and **business number**.
</Note>

## Outbound Format

The AI chooses the best format for each reply:

| Format                  | When used                                 | Limits                                                               |
| ----------------------- | ----------------------------------------- | -------------------------------------------------------------------- |
| **Plain text**          | Default for text-only replies             | Link previews enabled                                                |
| **Quick reply buttons** | 1–3 short options for the customer to tap | Max **3** buttons, **20** characters per button                      |
| **List menu**           | 4–10 options the customer selects from    | Max **10** rows, **24** characters per row title                     |
| **CTA URL button**      | Reply contains a single actionable link   | Body up to **1024** characters, button label up to **20** characters |

## Good To Know

<AccordionGroup>
  <Accordion title="Cross-Session Memory" icon="brain">
    WhatsApp is the only channel where the AI pulls context from **<Tooltip tip="WhatsApp-only feature where the AI pulls context from earlier resolved conversations for the same customer and business number.">prior resolved sessions</Tooltip>** for the same customer and business number. This means the AI can reference earlier conversations without the customer repeating themselves.
  </Accordion>

  <Accordion title="Media Handling" icon="photo-video">
    Voice notes are **transcribed** so the AI can read them. Images, video, and documents are attached to the conversation. Location pins become map links. Stickers and system messages are not processed.
  </Accordion>

  <Accordion title="Outbound Attachments" icon="paperclip">
    Attachments are sent as separate messages (one per file) followed by the text reply. There is a short pause between each.
  </Accordion>

  <Accordion title="Session Auto-Resolution" icon="clock">
    WhatsApp sessions auto-resolve after approximately **12 hours** of inactivity by default — longer than web chat (3 hours). Contact support to adjust your org's threshold.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Troubleshooting" icon="wrench" href="/whatsapp/troubleshooting">
    Missing replies, delivery failures, and error logs.
  </Card>

  <Card title="Messaging Rules" icon="scale-balanced" href="/whatsapp/whatsapp-rules">
    24-hour reply window, templates, and CSAT.
  </Card>

  <Card title="AI Actions" icon="bolt" href="/actions/introduction">
    Run tools and workflows from WhatsApp conversations.
  </Card>

  <Card title="Autopilot And Topics" icon="sliders" href="/handoff/topics">
    Channel-level Autopilot and topic rules.
  </Card>
</CardGroup>
