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

# Post-Purchase WhatsApp Sequences

> Event-triggered 4-stage WhatsApp lifecycle drips that drive repeat purchases, automate onboarding care, and capture verified CSAT reviews.

# Post-Purchase WhatsApp Sequences

For direct-to-consumer (D2C) brands, customer acquisition costs are at an all-time high. The highest-margin revenue comes not from acquiring new customers, but from **delighting existing buyers throughout the post-purchase lifecycle**.

**Galaxa Nova's Post-Purchase Sequence Engine** is an event-triggered, 4-stage WhatsApp state machine that runs entirely autonomously:

```mermaid theme={null}
flowchart TD
    A["Shopify Order Created"] --> B["Stage 1: Order Confirmed (T+0)\nInstant receipt & tracking link"]
    B --> C["Carrier Webhook (Bluedart/Delhivery)"]
    C --> D["Stage 2: Out for Delivery\nLive carrier tracking & delivery alert"]
    D --> E["Carrier Delivered Event"]
    E --> F["Stage 3: Onboarding & Care Guide (T+3 Days)\nUnboxing video, warranty & usage tips"]
    F --> G["Stage 4: Review & CSAT Rating (T+7 Days)\nAutomated 1-5 rating & review link"]
    G -->|Rating >= 4| H["Direct to Public Review on Google/Shopify"]
    G -->|Rating <= 3| I["Autonomous Escalation (<<<contact>>>)\nDirect Merchant Resolution"]
```

***

## The 4 Lifecycle Stages

### Stage 1: Order Confirmed (`T+0`)

Triggered immediately upon Shopify checkout completion.

* **Objective:** Immediate reassurance and order confirmation.
* **Payload:** Item breakdown, order number, estimated delivery date, and instant 1-click status lookup.
* **Benefits:** Prevents anxious buyers from submitting duplicate inquiries or attempting order cancellations.

### Stage 2: Out for Delivery (Carrier Event Trigger)

Triggered by carrier tracking status webhooks (e.g. Bluedart, Delhivery, Shiprocket, or Shopify Fulfillment).

* **Objective:** Ensure customer is available to receive the package, drastically reducing first-attempt delivery failures.
* **Payload:** Courier name, tracking AWB number, and estimated arrival window.
* **Anti-RTO Impact:** Reminds COD customers to keep exact cash or UPI ready, decreasing courier re-attempts by up to 28%.

### Stage 3: Onboarding & Care Guide (`Delivery + 72h`)

Triggered 72 hours after verified delivery.

* **Objective:** Drive customer product adoption and satisfaction before buyer's remorse can set in.
* **Payload:** Product setup instructions, video unboxing links, care/cleaning recommendations, and warranty registration prompts.
* **Commerce Impact:** Customers who successfully set up and use their purchase within 72 hours have a 3.4x higher likelihood of placing a second order within 90 days.

### Stage 4: Review & CSAT Rating (`Delivery + 168h / 7 Days`)

Triggered 7 days after verified delivery.

* **Objective:** Measure customer satisfaction (CSAT) and harvest verified 5-star public product reviews.
* **Payload:** Interactive 1-5 rating prompt directly in WhatsApp chat.

***

## Autonomous CSAT Sentiment Routing

Unlike legacy tools that dump customer ratings into a passive spreadsheet or require full-time human agents to man an inbox, Nova routes sentiment autonomously:

| CSAT Rating | Sentiment Classification | Autonomous Workflow |
| :-: | :- | :- |
| **4 – 5 Stars** | **High Satisfaction (Promoter)** | Thank the customer and provide a 1-tap link to leave a verified photo review on the merchant's Shopify or Google product page. |
| **1 – 3 Stars** | **Negative / At-Risk (Detractor)** | Emits `<<<contact>>>` escalation trigger. The AI agent apologizes, asks for specific feedback, and provides direct merchant support contact details (phone, email, WhatsApp) for rapid resolution. |

> [!NOTE]
>
> **Zero Human Takeover Inbox Required**: Nova resolves high-satisfaction loops automatically and connects at-risk customers directly with store owners via transparent escalation. No human agent seat fees or call-center shifts needed.

***

## State Machine Architecture & Reliability

The Sequence Engine (`src/services/sequenceEngine.js`) is designed for mission-critical reliability:

1. **State Persistence in Deno KV:**
   Each order's progression is recorded under atomic namespace keys:
   ```text theme={null}
   ["sequences", organizationId, orderId, stage]
   ```
2. **Periodic Cron Sweeper:**
   The background sweeper (`src/queue/cron.js` via `runSequenceSweeper`) processes pending lifecycle stages in scheduled batches, calculating precise delay intervals:
   * Care Guide Delay: `72 hours` (`259,200,000 ms`)
   * CSAT Review Delay: `168 hours` (`604,800,000 ms`)
3. **Idempotency Guarantees:**
   Stages cannot be double-sent. If a webhook fires repeatedly or a network timeout occurs, atomic transactional checks ensure messages are dispatched exactly once.
4. **Wholesale Meta Utility Pricing:**
   Order confirmation and delivery tracking messages qualify for Meta's lower-cost **Utility template tier** (\~₹0.1150 in India), delivering massive savings compared to promotional marketing campaigns.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.