Skip to main content

Ecommerce assistant

A WhatsApp shopper that does three things really well:
  1. Track orders — “where’s my package?” answered in 1 turn.
  2. Recommend products — “I need a gift for my sister, $50 budget”.
  3. Cart recovery — proactive nudges when someone abandons a cart.
This example mixes two patterns: the agent (reactive — replies to inbound) and a trigger (proactive — fires on inventory events).

Setup

The agent + tools

index.ts
For cart recovery via the function’s public URL, you need httpEnabled: true — but the function is then publicly addressable. Two ways to secure:

Option A: HMAC the cart webhook

Make your shop sign payloads:

Option B: Use Zavu triggers instead

If your shop is also “inside Zavu” (rare for ecommerce, common for messaging), you can use a custom event type. For most shops, Option A is the answer.

Sample conversations

Order tracking

Discovery → purchase

Proactive cart recovery

The shop’s backend posts to https://fn.zavu.dev/<project>/shopper 30 min after a customer abandons checkout. The function sends the nudge:

Deploy

If you want cart recovery, also enable HTTP on the function (via dashboard Function detail page → toggle “HTTP enabled”) or pass httpEnabled: true at first init. Note that this exposes the public URL — make sure your HMAC verification is in place.

Metrics worth watching

Composition with other Zavu primitives

Broadcasts

Black Friday: broadcast a 20% off code to your list. The agent picks up when customers reply with questions.

Templates

For the initial “your order is shipped” notification (outside the 24h window), use a WhatsApp template instead of the agent.

Contacts

Store lastOrderId, lifetimeValue, preferredCategory on contacts. The agent reads them automatically via includeContactMetadata: true.

Sub-accounts

Run separate agents for different storefronts under the same parent Zavu account.

Next

Define tools in depth

JSON schemas, error handling, the LLM’s selection logic.

Triggers

Native event subscriptions without HTTP.