Back to work
Case Study 02 · DTC Revenue OperationsLive · Sanitized case study

DTC Lifecycle Revenue Automation & Workflow Reliability

A lifecycle revenue automation system that connects order events, customer records, SMS preparation, time-zone aware check-ins, AI support routing, opt-out handling, and operational logging for DTC revenue operations.

n8nTwilioOpenAISupabaseGoogle SheetsWebhooksCustomer RetentionAI Support RoutingLifecycle AutomationWorkflow Reliability
2-minute read
  • What I built

    A lifecycle revenue automation that connects order events, customer records, time-zone aware SMS, AI support routing, opt-out handling, and operational logging for DTC operations.

  • Business problem

    Post-purchase journeys were fragmented across tools, customer replies fell through the cracks, opt-outs were inconsistent, and ops had no clear daily picture of what shipped, recovered, or failed.

  • System pattern

    Order event → Normalize → Persist state → Time-zone aware messaging → Reply classification → Route to AI / human / no-op → Update records → Daily reconciliation.

  • Reliability layer

    The system uses idempotent handlers, opt-out and consent enforcement at every outbound path, retry with backoff, structured AI outputs with confidence thresholds, and a daily reconciliation job that flags drift.

  • Main takeaway

    Lifecycle automation is mostly about state, safeguards, and visibility — the AI is one routing step, not the operation itself.

Architecture snapshot
  1. 01Order / event
  2. 02Normalization
  3. 03State persistence
  4. 04Time-zone aware messaging
  5. 05Reply classification
  6. 06Human / AI / no-op routing
  7. 07Logging & reconciliation

Customer-facing actions are gated by state and safeguards. The AI only routes — it never fires SMS, opt-outs, or refunds on its own.

My role

What I designed and built.

I designed and built the end-to-end lifecycle automation architecture, mapped the post-purchase customer journey, implemented the n8n workflows, connected order events, Supabase, Google Sheets, Twilio, and OpenAI, and designed the routing logic for customer replies, AI support responses, opt-out handling, human escalation, and daily preparation messages.

Lifecycle workflow architecture
Post-purchase retention journey
Customer record persistence
SMS preparation sequence
Daily check-in routing
AI support reply classification
Opt-out and eligibility safeguards
Human escalation paths
Workflow logging and state updates
Scope at a glance
Post-purchase workflow
Customer retention journey
SMS preparation sequence
Daily check-ins
AI support routing
Opt-out handling
Human escalation
Operational state tracking
The problem

Post-purchase communication was fragmented and hard to operate consistently.

DTC customers often need guidance after purchase: preparation instructions, product education, shipping expectations, check-ins, and support answers. Without a reliable workflow layer, those touchpoints become inconsistent, hard to track, and dependent on manual follow-up.

The business needed a system that could turn order events into a structured customer journey, keep customer records updated, send timely preparation messages, handle replies safely, and escalate sensitive cases to a human when needed.

The solution

A lifecycle workflow from order event to guided customer follow-up.

The system starts when a new order event is received. It validates and enriches customer data, checks eligibility and communication status, creates or updates operational records, sends a Day 0 preparation sequence, runs scheduled daily check-ins, listens for SMS replies, classifies customer intent, and routes each reply into the right downstream action.

Intake & customer state

  • Receives order events through webhooks
  • Stores order and customer context
  • Detects email provider from MX records
  • Creates or updates customer records
  • Maintains prep order state over time

Messaging & retention journey

  • Sends Day 0 welcome and preparation SMS
  • Delivers helpful content and resources
  • Runs time-zone aware daily check-ins
  • Routes outreach by day and eligibility
  • Logs sent messages and state changes

AI support & escalation

  • Listens for inbound SMS replies
  • Checks opt-out and customer status
  • Classifies replies by intent
  • Generates AI support replies when safe
  • Escalates sensitive cases to human support
Architecture

Event-driven lifecycle pipeline.

Each stage has a clear responsibility: receive the order, normalize customer data, check communication eligibility, send the right message, listen for replies, classify intent, update state, and escalate when necessary. AI is used for support reasoning and routing, but operational state and safeguards remain outside the model.

Order Event
Account Context
Customer Record
Email Provider Detection
Phone Validation
Opt-in Eligibility
Active Prep Order
Day 0 SMS
Daily Check-ins
Customer Reply
AI Intent Classification
Support Reply / Human Escalation
State Update & Logs
IntakeCustomer stateMessagingAI supportSafeguards
Inside the workflow

Screenshot walkthrough.

Sanitized views of the actual production workflow. Click any screenshot to view it full-size.

A

End-to-end lifecycle workflow

The full system includes initial order intake, customer record creation, phone and opt-in checks, Day 0 messaging, daily check-ins, SMS reply handling, AI support routing, and human escalation.

B

Incoming order event

The workflow begins with a secured order webhook that receives structured purchase data and creates the event context for downstream processing.

C

Customer record and enrichment layer

Before sending messages, the workflow stores order context, detects the customer's email provider, checks for an existing customer record, and creates or updates the operational profile.

D

Phone validation and eligibility checks

The system validates phone numbers, checks country and mobile safety conditions, confirms opt-in status, and creates ineligible records when outreach should not continue.

E

Day 0 preparation sequence

Eligible customers receive a welcome message and preparation resources, with delays and state updates between each outbound step.

F

Daily check-in automation

A scheduled, time-zone aware workflow finds active prep orders, filters eligible customers, routes outreach by day, sends the right message, and updates each prep order state.

G

Outreach routing by day

The daily check-in system branches by prep day, sending different educational messages, reminders, and support prompts across the customer journey.

H

Customer reply listener

Inbound SMS replies are saved, matched to the latest prep order, checked for opt-out intent, and used to update the customer's current support context.

I

AI reply classification and routing

Customer replies are classified by an AI router using memory and a knowledge base, then sent to either an AI support response path or a human support escalation path.

J

AI support and human escalation

The action layer separates routine support conversations from sensitive requests that require a human, while logging replies and pausing the prep order when needed.

Revenue workflow variants

The same lifecycle pattern, adapted across revenue moments.

The retention workflow was one part of a broader family of DTC revenue automations. Supporting workflows handled post-purchase upsell, checkout recovery, SMS split tests, payment-link routing, opt-out handling, customer state updates, and AI-assisted reply handling.

These variants are included as supporting evidence of scale and repeatability, while the customer retention workflow remains the main walkthrough.

01

Upsell automation variants

Post-purchase upsell workflows connected order events, customer records, business-hour routing, SMS/email outreach, payment-link generation, A/B testing, consent checks, AI-assisted replies, and operational logging.

02

Checkout recovery patterns

Checkout recovery workflows were designed for abandoned-cart events, short recovery links, consent-aware SMS follow-up, A/B testing, purchase-status checks, and AI-assisted responses grounded in product FAQ context.

What these variants prove
  • Revenue workflows were not one-off automations; they followed repeatable lifecycle patterns.
  • Customer state, consent, phone validation, and logging were reused across different revenue moments.
  • Upsell and checkout recovery flows required different business logic, but shared the same reliability principles.
  • AI was used for reply handling and product-aware support, while eligibility, consent, and operational writes stayed in deterministic workflow logic.
  • Split testing and variant routing enabled controlled experimentation without removing safeguards.
Technical implementation

The building blocks.

Customer state

  • Order context capture
  • Customer record lookup
  • Upsert profile logic
  • Prep order status
  • Last reply tracking
  • Active / paused state

Communication safeguards

  • Phone validation
  • Country checks
  • Mobile safety checks
  • SMS opt-in verification
  • Opt-out detection
  • Ineligible order handling

Lifecycle messaging

  • Day 0 welcome sequence
  • Preparation content delivery
  • Daily check-in trigger
  • Day-based routing
  • Message logging
  • Scheduled follow-up state

AI support workflow

  • Reply classification
  • FAQ / knowledge base lookup
  • AI support response generation
  • Memory-backed conversation context
  • Human support routing
  • Support escalation messaging

Reliability

  • Explicit workflow phases
  • State updates after each step
  • Logging for outbound and inbound messages
  • Fallback paths for invalid or opted-out customers
  • Separation of AI reasoning from operational writes
  • Manual handoff for sensitive requests
Proof of production thinking

Proof of production thinking

State management

The workflow tracks customer, lead, reply, order, or approval state instead of relying on one-off executions.

Human approval

Sensitive customer-facing actions are reviewed before being sent.

Fallback paths

Unclear, invalid, or risky cases are routed away from automatic execution.

Error visibility

Failures generate logs or alerts instead of failing silently.

Data normalization

Inputs are cleaned and structured before any AI or downstream action.

Operational handoff

The final output is written back into the tools people already use.

Reliability & safeguards

AI supports the journey, but state and safeguards control the system.

The workflow uses AI for classification and support responses, but the system does not rely on the model to decide eligibility, consent, or irreversible actions. Those decisions are handled through explicit workflow logic, customer records, and operational state.

  • Phone numbers are validated before outbound SMS.
  • Opt-in status is checked before customer outreach.
  • Opt-out replies pause the prep journey and update customer status.
  • Invalid or unsupported numbers are routed to ineligible records.
  • AI replies are limited to support conversations, not billing or irreversible actions.
  • Human escalation is triggered for sensitive support requests.
  • Every inbound and outbound message updates operational state.
  • Daily check-ins only run for active eligible prep orders.
  • FAQ / knowledge base context supports product-related answers.
Business impact

More consistent post-purchase support, with less manual follow-up.

Exact metrics are not public. The workflow outcomes below describe the operational improvements supported by the system after rollout.

Outcome
Faster customer activation

Customers received preparation guidance shortly after purchase instead of waiting for manual support or scattered follow-up.

Outcome
More consistent retention journey

The same customer success sequence could run across eligible customers with state, timing, and opt-out logic built in.

Outcome
Reduced manual support triage

Routine replies could be classified, answered, logged, or escalated without requiring an operator to inspect every message.

Outcome
Better customer record quality

Order context, communication state, reply history, and prep journey status were stored and updated throughout the workflow.

Outcome
Safer customer communication

Phone validation, opt-in checks, opt-out handling, and human escalation reduced risk in outbound messaging.

Outcome
Reusable lifecycle pattern

The same architecture can be adapted to other DTC brands, products, post-purchase journeys, and retention campaigns.

Lessons learned

What this build taught me.

  1. 01

    Retention workflows need state, not just scheduled messages.

  2. 02

    AI support is safer when routing, eligibility, and opt-out logic live outside the model.

  3. 03

    Post-purchase automation works best when it helps the customer prepare, not just when it sells.

  4. 04

    Daily messaging needs strict eligibility checks to avoid contacting the wrong customer.

  5. 05

    Human escalation should be designed into the workflow from the beginning.

Next version

Where this system goes next.

The same pattern, hardened for broader lifecycle revenue operations.

  • Unified dashboard for active prep orders, replies, opt-outs, and escalations.
  • Queue-based retries for SMS and API writes.
  • More granular analytics by product, day, reply type, and retention outcome.
  • Prompt regression tests for AI support replies.
  • Role-based human review interface for escalations.
  • Centralized template management for lifecycle messages.
  • Expanded lifecycle variants for upsell, abandoned cart recovery, and winback.

Need lifecycle automation that handles customers, replies, opt-outs, and escalation safely?