Skip to main content
The Lacanians
Startup7 min read

From One Client Need to a Product: WhatsApp Satisfaction Surveys

Dos Palomitas began as post-sale surveys over WhatsApp for one sales and CX team. Here is how we turned that single need into a product other businesses can adopt without annoying their customers.

A

Abdul Hamid Achik

One Customer, One Narrow Need

A sales and customer experience team wanted to know how customers felt right after a purchase. Email surveys went unanswered, and a phone call from the team was too heavy for a routine check. Their customers already lived in WhatsApp, so that is where the question had to go.

That is a bespoke project on day one: one team, one process, one set of rules. The risk with bespoke work is that you build exactly that and nothing else. The opportunity is that the same need exists in many businesses, in almost the same shape.

We chose to build it as a product. Dos Palomitas is the result: post-sale satisfaction surveys over WhatsApp that a business can adopt without making its customers feel chased. This post covers the design decisions, and the lesson about drawing boundaries that made the product reusable.

Why WhatsApp Flows

The obvious design is a message with a link to a web form. It fails for the same reason email does: the customer has to leave the chat, wait for a page, and decide whether to trust it.

A WhatsApp Flow is a native form that opens inside the conversation. After each sale the customer gets a message, taps a button, answers a few questions on a 1-to-10 scale, and gets a thank-you. They never leave the chat, and the answers arrive as structured data rather than free text we would have to parse.

The survey itself is data, not code. Questions, template bodies, buttons and the thank-you message live in a versioned survey form that the team edits in the panel. Published and active versions are immutable, so editing means duplicating, and every survey keeps the version it was sent with.

The Survey Lifecycle as a Durable Workflow

Each survey needs to wait: for the customer to answer, for a reminder time, for expiration. A survey can sit open for days, so a cron job that polls the database would keep compute awake for nothing.

We model each survey as one durable workflow: send, wait, one reminder, expiration. The workflow sleeps without consuming compute. This is the core of it, shortened from the repo:

export async function surveyWorkflow(surveyId: string) {
  'use workflow'

  const p = await prepareSurvey(surveyId)
  using onResponse = responseHook.create({ token: p.token })
  using onOptOut = optOutHook.create({ token: optOutToken(p.token) })

  const response = onResponse.then((data) => ({ type: 'response' as const, data }))
  const optedOut = onOptOut.then(() => ({ type: 'opt_out' as const }))

  // Outside 8:00-20:00 (central Mexico time) it sleeps until 8:00.
  const firstSend = await nextSendTime(p.window)
  if (firstSend) await sleep(new Date(firstSend))

  const sent = await sendSurveyTemplate(surveyId, 'purchase', p.expirationMinutes)
  const reminderAt = new Date(new Date(sent.sentAt).getTime() + p.reminderMinutes * 60_000).toISOString()
  let event = await Promise.race([response, optedOut, until(reminderAt)])
  // ...one reminder, then wait for the response until expiration
}

Two details matter. The hooks are registered before the message goes out, so an immediate answer is never lost. And if a second run starts for the same survey, it finds the token taken and ends before it can send anything twice. Sending twice is the failure customers notice.

If you want the broader pattern of making agents and systems prove what they did, we wrote about it in Done Is Not Verified. The same instinct applies here: a retry must never become a duplicate message.

Low Scores Open a Case

A survey is only useful if a bad answer leads to someone acting on it. A score of 8 or less opens a follow-up case for the CX team. The threshold is a setting, not a constant, and it defaults to 8.

A case records what happened, the friction stage, the responsible area, the root cause and the improvement action, and moves through open, in review and closed. The case is created once per survey, so a replayed webhook cannot open a duplicate.

Respectful by Default

“Without being intrusive” turned into concrete rules rather than a tone of voice.

  • One reminder only. The workflow sends a single reminder, then waits for expiration. It never sends a second.
  • A send window. Messages go out between 8:00 and 20:00 central Mexico time. Outside that, the workflow sleeps until morning.
  • Frequency rules. The cut that decides who gets surveyed excludes customers and phone numbers contacted recently, and contacts without consent.
  • A way out. Customers can reply BAJA (or STOP in English) or tap an opt-out button. The opt-out is permanent, and a later import never undoes it.

Each template carries an opt-out button or footer, and free text sent to the number gets a polite reply pointing back to the survey button.

Results by Segment

The panel shows response rate, average score and the share of surveys needing attention, plus breakdowns by segment such as branch, product family and customer type. The segments are fields on the sale, so a new business maps its own data to them.

Small samples are shown as hints rather than verdicts. Below five responses, a percentage is not presented as a conclusion. A manager who reads “100% satisfied” from two answers will make a worse decision than one who sees no number.

Testing Without Hitting Meta

Integrating with WhatsApp is slow to test: templates need approval, and every message goes through a real platform. We built two escape hatches.

In mock mode (WHATSAPP_MODE=mock) nothing reaches Meta. Messages are stored in the database, and the panel shows a simulated phone that plays the customer. You can run the whole cycle on a laptop.

For the inbound side, a simulator script sends webhooks signed the way Meta signs them: an HMAC-SHA256 of the raw body in the X-Hub-Signature-256 header. The webhook verifies that signature before parsing anything, so tests exercise the real validation path.

bun run simulate respond <token> 9 10 8
bun run simulate opt-out <token> <phone>

The unit tests run against an in-memory Postgres with every migration replayed, and the repo’s suite covers the 13 scenarios for who gets surveyed. None of it touches the network.

Spanish First

The product is Spanish by default, with English under /en. Message templates exist as es_MX and en_US, and opt-out keywords exist in both languages. Code stays in English; user-facing text is data or translation files.

Starting Spanish-first changed the work. We wrote the survey copy, the system replies and the legal pages Meta requires for the audience that needed them, instead of translating an English default afterward.

The Lesson: Boundaries Make a Reusable Product

Moving from a client project to a product came down to three decisions.

  1. Name what is configuration. Thresholds, reminder timing, send windows, questions and segments are settings or data. Anything one customer would want to change belongs there, not in code.
  2. Isolate integrations. The product takes sales through an API, a CSV import or connectors, and turns each into one internal sale shape. The core never learns where a sale came from.
  3. Keep the demo separate from a real installation. A production installation runs with its own project, database and WhatsApp number, and demo-only features are disabled there.

We apply the same discipline when a founder asks us to rescue a prototype: decide what is the product and what is the first customer. If you are weighing that choice for your own software, our product engineering work starts there.

A

Abdul Hamid Achik

Founder and lead engineer at The Lacanians. Abdul builds production software, developer tools, and local-first systems from Guadalajara for teams worldwide.