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.
- 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.
- 01Order / event
- 02Normalization
- 03State persistence
- 04Time-zone aware messaging
- 05Reply classification
- 06Human / AI / no-op routing
- 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.
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.
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.
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
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.
Screenshot walkthrough.
Sanitized views of the actual production workflow. Click any screenshot to view it full-size.
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.
Incoming order event
The workflow begins with a secured order webhook that receives structured purchase data and creates the event context for downstream processing.
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.
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.
Day 0 preparation sequence
Eligible customers receive a welcome message and preparation resources, with delays and state updates between each outbound step.
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.
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.
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.
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.
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.
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.
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.
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.
- 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.
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
The workflow tracks customer, lead, reply, order, or approval state instead of relying on one-off executions.
Sensitive customer-facing actions are reviewed before being sent.
Unclear, invalid, or risky cases are routed away from automatic execution.
Failures generate logs or alerts instead of failing silently.
Inputs are cleaned and structured before any AI or downstream action.
The final output is written back into the tools people already use.
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.
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.
Customers received preparation guidance shortly after purchase instead of waiting for manual support or scattered follow-up.
The same customer success sequence could run across eligible customers with state, timing, and opt-out logic built in.
Routine replies could be classified, answered, logged, or escalated without requiring an operator to inspect every message.
Order context, communication state, reply history, and prep journey status were stored and updated throughout the workflow.
Phone validation, opt-in checks, opt-out handling, and human escalation reduced risk in outbound messaging.
The same architecture can be adapted to other DTC brands, products, post-purchase journeys, and retention campaigns.
What this build taught me.
- 01
Retention workflows need state, not just scheduled messages.
- 02
AI support is safer when routing, eligibility, and opt-out logic live outside the model.
- 03
Post-purchase automation works best when it helps the customer prepare, not just when it sells.
- 04
Daily messaging needs strict eligibility checks to avoid contacting the wrong customer.
- 05
Human escalation should be designed into the workflow from the beginning.
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.
