Back to work

D2C WhatsApp AI Support · Support automation

A support message sorted, looked up and answered

Built for a D2C brand's support inbox. A message arrives on WhatsApp, is sorted into one of five kinds, checked against the brand's own services and answered in one reply.

What the workflow handles

  • 5Kinds of message
    What it covers
    Order tracking, returns and refunds, product advice, complaints and general questions. A message is sorted into exactly one. An answer outside those five is treated as a general question.
  • 4Services asked for facts
    What it covers
    The order, returns, product and ticket services are each called by one route before a reply is written. General questions have no lookup and are answered with an empty context.
  • 15 minCampaign queue check
    What it covers
    A schedule reads a queue of customers to message every 15 minutes. Campaign types in the prompt are abandoned cart, cash-on-delivery confirmation, delivery reminder, post purchase, review request, reorder reminder and cross-sell.
  • 1Error log route
    What it covers
    When the workflow fails, the failure is posted to a logging service with the workflow name, the run id and the error.

How a message moves

  1. A message arrivesOn WhatsApp
  2. It is sortedOne of five kinds
  3. Facts are looked upOrder, return, product, ticket
  4. A reply goes outWritten from those facts

How it works, in detail

For technical reviewers: the workflow, its routes and architecture.

TriggerStepAnswer to senderRedrawn from the build’s layout file

Inside the automation · 35 nodes, 3 chat models shown inside their AI steps

From message to reply

Scroll the steps. Tap any node for its job, retries and what it sends.

  1. WhatsApp support1 / 9

    GET

    Platform setup check

    How it works
    The same webhook path answers a GET for the platform's setup check. The response is the hub.challenge value from the query, or an empty reply when there is none. Nothing compares a verify token.
  2. WhatsApp support2 / 9

    POST

    Pull out the customer text

    How it works
    Each event arrives as a POST. One code step takes the first message: id, sender number, contact name, type and text, where a button or list reply counts through its title. An event with no message is marked ignore, and the check after it lets only events with text continue.
  3. WhatsApp support3 / 9

    5

    One of five intents

    How it works
    The agent returns JSON with the intent, needs_human, needs_call, an order id when one is clearly present, and a reason. Its prompt flags a human for threats, legal issues, payment disputes, repeated failures and abuse. Parse Intent reads the JSON: invalid JSON, or an intent outside the five, becomes general_support, and invalid JSON also sets needs_human. The chat model behind the agent is gpt-5-mini at temperature 0.2.
  4. WhatsApp support4 / 9

    4

    Four routes, four lookups

    How it works
    Four yes/no checks run in a chain: order, returns, products, complaint. A yes calls one service: order status (GET with order_id and phone), return eligibility (POST with the action evaluate), product search (POST with the customer's text) or ticket creation (POST, priority high when needs_human is set). Anything left over is general support with no lookup. Each call times out after 20 s and has no retry.
  5. WhatsApp support5 / 9

    700

    Reply from the result only

    How it works
    Each route wraps its result with the parsed message, and the reply agent gets that JSON. Its prompt treats the result as the source of truth and bars inventing order status, refund amounts, dates, products or policy outcomes. It must tell the customer a human specialist will take over when needs_human is set, confirm a callback request when needs_call is set, stay under 700 characters and return only the message.
  6. WhatsApp support6 / 9

    needs_call

    Callback goes to a voice service

    How it works
    When the parsed message has needs_call set, the callback request is posted to a voice-agent service with the phone, the language hi-IN, the customer's message, name and source. The reply is still sent afterwards. The telephony link behind that service depends on the provider chosen.
  7. WhatsApp support7 / 9

    2 → 1

    Replies and campaigns share one send

    How it works
    Build WhatsApp Reply makes the text message, with an apology and a line that a specialist will help shortly if the agent returned nothing. Send WhatsApp Message posts to the WhatsApp Cloud API and sends a template when send_type is template, plain text otherwise. The campaign branch feeds the same node.
  8. WhatsApp support8 / 9

    15 min

    Campaign messages on a timer

    How it works
    Every 15 minutes the queue is read and items without a phone or campaign type are dropped. A third agent writes one short message per item from the supplied context only, under 600 characters, and the message becomes the body of a template unless the queue item already carries template components.
  9. WhatsApp support9 / 9

    POST

    Failures posted to a log

    How it works
    The error trigger starts when a workflow fails. One POST sends the workflow name, the run id and the error to a logging service, with a 15 s timeout. There are no retries and no per-node error branches elsewhere in the workflow.

Build notes

What the workflow file shows about how it is built, and what it leaves open.

The reply comes from a lookup, not from the model

What it does
Four of the five routes call a service first: order status, return eligibility, product search or ticket creation. The reply agent receives that result and its prompt bars inventing order status, refund amounts, dates, products or policy outcomes. General questions have no lookup, and each call is an address read from environment settings, so no single commerce, order or helpdesk vendor is built in.

An unusable answer has a fallback

What happens
If the intent agent returns invalid JSON, the message is treated as a general question with the human flag set. If the reply agent returns nothing, the customer gets an apology and a line that a specialist will help shortly.

Escalation is a message, not a queue

The limit
The human flag changes the reply wording and sets a ticket to high priority on the complaint route. No node creates a queue for a person to work from, so that part is still to be built.

Environment-based configuration

Portable integrations
Credentials and service endpoints live in environment configuration rather than hard-coded URLs, making the workflow portable across any commerce, order or helpdesk backend.

Deployment hardening

Checklist
Before pointing at a storefront, configure webhook signature verification, message-id deduplication, idempotency keys on ticket and return writes, and retry/backoff rules alongside the 20 s HTTP timeouts.

Next

Client Intake and Case Management

Client Intake and Case Management