
Lifecycle Marketing Automation
- 64 installs
- 41 repo stars
- Updated March 13, 2026
- finsilabs/awesome-ecommerce-skills
Set up behavior-triggered email/SMS flows for each customer lifecycle stage, from welcome series to at-risk retention, in Klaviyo or AutomateWoo.
About
Maps customers into lifecycle stages (subscriber, first-time buyer, loyal, at-risk, lapsed) and configures stage-appropriate triggered messaging across Shopify, WooCommerce, BigCommerce, or a headless stack. A developer uses it when moving from batch email campaigns to automated, behavior-driven flows.
- Per-stage flow setup in Klaviyo, AutomateWoo, and via the Klaviyo profile API for headless stores
- Flow filters to cancel win-back/retention flows on purchase and measure lifecycle health metrics
Lifecycle Marketing Automation by the numbers
- 64 all-time installs (skills.sh)
- Ranked #529 of 853 Sales & Marketing skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill lifecycle-marketing-automationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 64 |
|---|---|
| repo stars | ★ 41 |
| Last updated | March 13, 2026 |
| Repository | finsilabs/awesome-ecommerce-skills ↗ |
What it does
Set up behavior-triggered email/SMS flows for each customer lifecycle stage, from welcome series to at-risk retention, in Klaviyo or AutomateWoo.
Files
Lifecycle Marketing Automation
Overview
Lifecycle marketing treats each customer as being at a defined stage in their relationship with your brand — from anonymous visitor to loyal advocate — and delivers stage-appropriate messaging automatically. Unlike broadcast campaigns, lifecycle automation is triggered by behavior and stage transitions, ensuring every message is relevant. Klaviyo's predictive analytics and flow builder cover most lifecycle automation needs without custom code.
When to Use This Skill
- When moving from batch-and-blast campaigns to behavior-triggered messaging
- When different customer segments are receiving identical generic emails
- When onboarding new customers and needing a structured first-30-day nurture plan
- When LTV and repeat purchase rate are flat despite healthy acquisition numbers
- When building a holistic view of the customer journey across email, SMS, and push
Core Instructions
Step 1: Define your lifecycle stages
| Stage | Definition | Primary Goal |
|---|---|---|
| Subscriber | Email captured, no purchase | Convert to first purchase |
| First-time buyer | 1 order, placed < 60 days ago | Onboard, reduce returns, build habit |
| Active | 2+ orders, purchased within repurchase window | Grow AOV and purchase frequency |
| Loyal | 4+ orders OR > $500 LTV | Maintain, protect from churn, reward |
| At-risk | Approaching 1.5x their normal repurchase window | Proactive re-engagement |
| Lapsed | Beyond 2x their normal repurchase window | Win-back campaign |
| Advocate | Has reviewed, referred, or engaged heavily | Amplify via referral program |
Step 2: Set up lifecycle automation per stage
---
Shopify with Klaviyo
Klaviyo computes expected repurchase dates and churn risk automatically based on your order history — you do not need to calculate lifecycle stages manually.
Subscriber stage — Welcome Series: 1. Go to Klaviyo → Flows → Create Flow → Welcome Series (use template) 2. The flow fires when someone joins your email list 3. Configure 3 emails over 7 days:
- Email 1 (immediate): Welcome + brand story + first-order discount
- Email 2 (day 2): Bestsellers or "Start here" product guide
- Email 3 (day 7): Social proof (reviews, customer photos, media mentions)
4. Add a flow filter: "Has NOT placed an order" — exits the flow if they purchase before completing it
First-time buyer stage — Post-Purchase Onboarding: 1. Create a new flow: trigger = Placed Order, filter = "First order ever" (Klaviyo's "First order" conditional) 2. Configure 3 emails:
- Email 1 (day 2): Product usage tips or setup guide
- Email 2 (day 7): Cross-sell recommendations based on purchased product
- Email 3 (day 21): Review request
3. This flow is separate from the standard post-purchase flow to give first-timers extra attention
Loyal stage — VIP Recognition: 1. Create a segment: Total Customer Value > $500 OR Total Order Count >= 4 2. Create a flow triggered by Segment Entry for this segment 3. Send a single "You've unlocked VIP status" email with exclusive benefits (early access, free shipping, loyalty points bonus) 4. Add these customers to a Klaviyo List called "VIP" and use it as a segment for early access campaigns
At-risk stage — Retention Nudge: 1. Create a segment using Klaviyo's predictive analytics: Predicted Churn Risk = High OR Mid 2. Create a flow triggered by Segment Entry:
- Email 1 (immediate): Personalized "We miss you" with product recommendations based on past purchases
- Wait 5 days → Email 2: New arrivals or "What's changed since your last visit"
- Wait 5 days → Email 3 (only for customers with > $200 LTV): 15% off exclusive offer
Lapsed stage → Win-Back:
- See @win-back-reactivation for the full win-back campaign setup
---
WooCommerce with AutomateWoo
1. Install AutomateWoo ($99/yr) from the WooCommerce marketplace 2. Build individual workflows for each stage transition:
Welcome Series:
- Trigger: Subscribe → Newsletter (with your email plugin) or Customer → Created (new account)
- Add 3 email actions with timing delays
Post-purchase onboarding:
- Trigger: Order → Status Changed to Completed
- Add condition: Customer order count equals 1 (first-time buyer)
- Configure email sequence with delays
At-risk re-engagement:
- Trigger: Customer → Win Back (built-in AutomateWoo trigger)
- Set "No order in last" to 1.5x your average repurchase cycle
- Create escalating emails: reminder → offer
AutomateWoo's built-in RFM Analysis (go to AutomateWoo → Reports → RFM Analysis) shows your customers on an RFM grid — use this to identify which customers to target with each lifecycle stage campaign.
---
BigCommerce
1. Install Klaviyo from the BigCommerce App Marketplace 2. Klaviyo syncs all BigCommerce order history automatically 3. Follow the same Klaviyo flow setup as the Shopify section above
---
Custom / Headless
Send lifecycle events to Klaviyo's API:
// Update customer's lifecycle stage as a Klaviyo profile property
async function updateLifecycleStage(email: string, stage: string) {
await fetch('https://a.klaviyo.com/api/profile-import/', {
method: 'POST',
headers: {
'Authorization': `Klaviyo-API-Key ${process.env.KLAVIYO_PRIVATE_KEY}`,
'Content-Type': 'application/json',
'revision': '2024-10-15',
},
body: JSON.stringify({
data: {
type: 'profile',
attributes: {
email,
properties: {
lifecycle_stage: stage,
lifecycle_stage_updated_at: new Date().toISOString(),
},
},
},
}),
});
}
// Call this on key events:
// After first purchase: updateLifecycleStage(email, 'first-time-buyer')
// After 4th purchase or $500 LTV: updateLifecycleStage(email, 'loyal')
// When churn risk detected: updateLifecycleStage(email, 'at-risk')Then in Klaviyo, create flows triggered by Profile Property Changed → lifecycle_stage equals [stage].
Step 3: Configure stage-appropriate messaging
| Stage | Channel | Frequency | Content Focus | Incentive |
|---|---|---|---|---|
| Subscriber | Weekly | Brand education, social proof | First-order discount | |
| First-time buyer | Triggered only | Product onboarding, care tips | No discount — build value | |
| Active | Biweekly | New arrivals, cross-sell | None (they are buying) | |
| Loyal | Weekly | Exclusive access, new drops | Early access, not discounts | |
| At-risk | Email + SMS | Triggered only | Re-engagement, recommendations | Small offer for high-LTV only |
| Advocate | Biweekly | Referral program, exclusives | Referral bonuses |
Step 4: Measure lifecycle health
Track these in Klaviyo or your analytics dashboard:
| Metric | Target | Where to Find |
|---|---|---|
| Subscriber → first purchase conversion | > 10% within 30 days | Klaviyo → Welcome series flow analytics |
| First-time buyer repeat purchase rate | > 30% within 90 days | Shopify: Analytics → Customer cohorts |
| At-risk customers saved | > 20% convert after retention flow | Klaviyo → Segment size change over time |
| Loyal customer share of revenue | > 40% of total revenue | Klaviyo → VIP segment campaign analytics |
Best Practices
- Cancel competing flows on conversion — in Klaviyo, add a flow filter to every win-back and retention flow: "Has placed order since starting flow → exit"; prevents irrelevant messages after purchase
- Always cancel retention flows when a customer purchases — set up a Klaviyo flow that triggers on "Placed Order" and uses a Trigger Split to exit the person from any active retention flows
- Use Klaviyo's predictive analytics — do not manually calculate lifecycle stages; Klaviyo's expected next purchase date and churn risk are more accurate than manual rules
- Personalize with dynamic product blocks — every retention and win-back email should show products based on what the customer has bought before, not generic bestsellers
- Keep stage definitions simple — 5–7 stages is enough; adding more stages creates messaging overlap and complexity without proportional benefit
Common Pitfalls
| Problem | Solution |
|---|---|
| Customers receive win-back email after just buying | Add flow filter "Has placed order in last 7 days → exit" and verify the Placed Order event is firing in Klaviyo |
| All customers stuck in "subscriber" stage | Check that Placed Order events are syncing from Shopify to Klaviyo; verify integration is active under Klaviyo → Integrations |
| Loyal customers receiving lapsed messaging | Segment filters in Klaviyo run at entry time; add re-evaluation by using Flow Filters that check current lifetime value before each send |
| Welcome series and post-purchase flow both send to new buyers | Add a flow filter to the Welcome Series: "Has NOT placed an order" — this exits them from Welcome when they buy |
Related Skills
- @customer-retention-engine
- @email-marketing-automation
- @win-back-reactivation
- @loyalty-program-optimization
- @email-list-segmentation
{
"context": "Tests whether the agent implements the correct per-stage campaign configuration (channels, frequency, incentive levels), re-validates stage at send time, correctly triggers advocate promotion via review count threshold, and builds an analytics dashboard with the required metrics.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Config covers all 8 stages",
"max_score": 8,
"description": "The STAGE_CAMPAIGN_CONFIG (or equivalent) has entries for all 8 lifecycle stages: anonymous, subscriber, first-time-buyer, active, loyal, at-risk, lapsed, advocate"
},
{
"name": "Anonymous uses push channel",
"max_score": 8,
"description": "The anonymous stage config specifies push (not email or SMS) as the primary channel"
},
{
"name": "Lapsed has high incentive",
"max_score": 8,
"description": "The lapsed stage config specifies 'high' as the incentive level (the highest available, reflecting win-back offer strategy)"
},
{
"name": "First-time-buyer triggered-only",
"max_score": 8,
"description": "The first-time-buyer stage config specifies 'triggered-only' frequency (not weekly or biweekly)"
},
{
"name": "Loyal no discount needed",
"max_score": 8,
"description": "The loyal stage config specifies incentiveLevel 'none' or 'low' (does NOT specify 'high' — loyal customers don't need heavy discounts)"
},
{
"name": "Active no incentive",
"max_score": 6,
"description": "The active stage config specifies incentiveLevel 'none' (active customers don't need incentives)"
},
{
"name": "Stage re-validated at send time",
"max_score": 12,
"description": "The campaign send function (or equivalent) fetches the customer's CURRENT lifecycle stage at the time of sending and aborts/skips the send if the stage has changed from the expected stage"
},
{
"name": "Advocate at 2+ reviews",
"max_score": 10,
"description": "The onReviewSubmitted handler checks the review count and promotes the customer to 'advocate' when count >= 2 (not 1, not 3)"
},
{
"name": "Dashboard includes stageDistribution",
"max_score": 6,
"description": "The analytics dashboard returns a stageDistribution showing customer counts per stage"
},
{
"name": "Dashboard includes stageMoveRate",
"max_score": 8,
"description": "The analytics dashboard includes stage transition rates (at minimum: subscriberToFirstBuyer and atRiskSaved conversions)"
},
{
"name": "Dashboard includes avgTimeInStage and stageLTV",
"max_score": 10,
"description": "The analytics dashboard returns both avgTimeInStage and average LTV broken down by lifecycle stage"
},
{
"name": "Config has frequency field",
"max_score": 8,
"description": "The campaign config for each stage includes a frequency field distinguishing weekly/biweekly/triggered-only stages"
}
]
}
Lifecycle Campaign Layer and Analytics
Problem Description
Nourish & Co. is a health food e-commerce company that has just deployed a customer lifecycle stage engine. Now they need to build the campaign management layer on top of it, plus an analytics dashboard so the marketing team can monitor health of the funnel.
The engineering team has two immediate needs:
Campaign configuration: Different lifecycle stages need different treatment — the channel used to reach customers, how often they receive messages, what the messaging focuses on, and whether incentives like discounts are offered. Anonymous visitors (those who haven't yet shared their email) are harder to reach through traditional channels; lapsed customers are the hardest to win back and may need a meaningful incentive; loyal customers should get exclusive content and typically don't need financial incentives to engage. The team wants a central config object that encodes these rules so campaign workers can look up the right parameters without hard-coding decisions. A critical concern: the marketing ops team has seen campaigns fire with stale stage data — a customer who made a purchase yesterday might still get a "we miss you" email if the campaign worker uses the stage from when the job was enqueued rather than the current stage.
Real-time event hooks: The lifecycle engine runs nightly, but two events need to update a customer's stage immediately without waiting for the batch: (a) when a customer submits a product review, reaching a threshold of reviews should move them into the advocate tier; (b) webhook handlers for other real-time purchase events should also feed into stage re-evaluation.
Analytics dashboard: The team wants visibility into funnel health — how customers are distributed across stages, which transitions are happening (and at what rates), how long customers spend in each stage, and the average LTV by stage.
Output Specification
Produce a TypeScript file campaign-layer.ts containing: 1. A STAGE_CAMPAIGN_CONFIG object (or equivalent) mapping every lifecycle stage to its campaign parameters 2. A sendCampaignToCustomer(customerId, campaignType) function (or equivalent) that guards against stale stage data at send time 3. An onReviewSubmitted(customerId) event handler 4. A getLifecycleDashboard() function
Also write campaign-design.md explaining how the campaign config decisions were made for each stage, particularly around channel selection and incentive levels.
{
"context": "Tests whether the agent implements the correct lifecycle stage taxonomy, classification logic with proper thresholds, a batch-safe nightly job, and a hysteresis mechanism to prevent stage thrashing.",
"type": "weighted_checklist",
"checklist": [
{
"name": "8 exact stage names",
"max_score": 8,
"description": "The LifecycleStage type includes all of: 'anonymous', 'subscriber', 'first-time-buyer', 'active', 'loyal', 'at-risk', 'lapsed', 'advocate' (no extra stages, no renamed stages)"
},
{
"name": "CustomerLifecycle interface shape",
"max_score": 8,
"description": "A CustomerLifecycle interface (or equivalent) exists with at minimum: customerId (string), stage, enteredStageAt (Date), previousStage (optional), and metadata fields"
},
{
"name": "Anonymous check uses emailVerified",
"max_score": 8,
"description": "The stage assignment checks customer.emailVerified (or equivalent) to return 'anonymous' — not absence of email address alone"
},
{
"name": "First-time-buyer 60-day threshold",
"max_score": 10,
"description": "The 'first-time-buyer' stage requires exactly 1 order AND the last order was placed within 60 days (daysSince <= 60)"
},
{
"name": "Loyal thresholds correct",
"max_score": 10,
"description": "The 'loyal' stage is assigned when LTV >= 500 OR order count >= 4 (both conditions handled as OR, not AND)"
},
{
"name": "At-risk uses purchase frequency",
"max_score": 10,
"description": "The 'at-risk' classification computes average purchase frequency and triggers when daysSince > avgFreq AND daysSince < avgFreq * 2"
},
{
"name": "Lapsed uses 2x frequency",
"max_score": 10,
"description": "The 'lapsed' classification triggers when daysSince > avgFreq * 2 (or no prior order exists)"
},
{
"name": "Nightly batch job present",
"max_score": 8,
"description": "An updateLifecycleStages (or equivalent) function exists that iterates all email-verified customers and re-evaluates their stage"
},
{
"name": "Batch chunking / pagination",
"max_score": 10,
"description": "The nightly batch job processes customers in chunks (e.g. batches of 1000) using cursor pagination rather than loading all records at once"
},
{
"name": "Hysteresis mechanism",
"max_score": 10,
"description": "The implementation includes a mechanism to require a stage to be stable across 2 consecutive evaluations before triggering a workflow transition (prevents daily stage flipping)"
},
{
"name": "Stage count <= 8",
"max_score": 8,
"description": "The implementation does NOT define more than 8 lifecycle stages (no micro-stages like 'new-subscriber', 'semi-loyal', etc.)"
}
]
}
Customer Lifecycle Stage Engine
Problem Description
Growthwave is a mid-sized DTC apparel brand that has been running a single broadcast newsletter to its entire customer base. The marketing team has noticed declining open rates and repeat purchase rates, and the VP of Growth suspects that customers are receiving completely irrelevant emails — loyal customers get the same acquisition-focused messages as someone who signed up yesterday but never bought anything.
The engineering team has been tasked with building a core customer lifecycle classification module in TypeScript. This module will form the foundation of a new behavior-triggered automation platform. The goals are: (1) classify every customer into the right lifecycle bucket based on their purchase history and engagement signals, and (2) keep the stage model simple enough for non-technical marketers to understand and act on.
The system should be designed to run reliably at scale — Growthwave has roughly 400,000 customers, so the nightly re-evaluation job needs to be written with performance in mind to avoid timeouts.
Output Specification
Produce a TypeScript module (one or more .ts files) that implements:
1. The lifecycle stage taxonomy as TypeScript types and interfaces 2. A function assignLifecycleStage(customerId) that classifies a customer 3. A batch update function updateLifecycleStages() that nightly re-evaluates all customers — make sure it handles large tables without timing out 4. A mechanism to prevent a customer from bouncing back and forth between stages on consecutive nightly runs
Write the output to a file named lifecycle-engine.ts.
Additionally, write a brief design-notes.md describing:
- The stage taxonomy you chose and why
- How the at-risk and lapsed thresholds work
- Any performance optimizations in the batch job
- How you handle the stage-stability problem
{
"context": "Tests whether the agent correctly implements stage-transition workflows with the right actions per transition, proper flow cancellation on purchase, conditional win-back logic, and produces a transition matrix document.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Welcome series on subscriber",
"max_score": 8,
"description": "The transition to 'subscriber' stage triggers a welcome series (e.g. triggerWelcomeSeries or equivalent)"
},
{
"name": "Cancel welcome on first purchase",
"max_score": 10,
"description": "The transition to 'first-time-buyer' calls cancelFlow (or equivalent) to cancel the welcome series BEFORE scheduling the onboarding flow"
},
{
"name": "First-purchase onboarding scheduled",
"max_score": 8,
"description": "The transition to 'first-time-buyer' schedules a first-purchase onboarding flow (covering setup tips, product usage, and/or review request)"
},
{
"name": "Second-purchase milestone email",
"max_score": 10,
"description": "The transition to 'active' from 'first-time-buyer' specifically sends a milestone email for the second purchase (does NOT fire for all transitions to 'active')"
},
{
"name": "Loyal adds to VIP audience",
"max_score": 8,
"description": "The transition to 'loyal' calls addToVipAudience (or equivalent) in addition to a milestone email"
},
{
"name": "At-risk nudge without discount",
"max_score": 10,
"description": "The transition to 'at-risk' sends a retention/re-engagement message, and the code or documentation explicitly indicates no discount/incentive is offered at this stage"
},
{
"name": "Win-back only from at-risk",
"max_score": 10,
"description": "The win-back campaign (or escalated offer) on transition to 'lapsed' is conditional — it only fires when the previous stage was 'at-risk', not unconditionally"
},
{
"name": "Advocate reward triggered",
"max_score": 8,
"description": "The transition to 'advocate' stage triggers a reward (exclusive perks, referral bonus, or equivalent)"
},
{
"name": "Cancel all retention flows on purchase",
"max_score": 10,
"description": "The onOrderPaid (or equivalent purchase event handler) calls cancelAllRetentionFlows (or equivalent) to stop ALL competing win-back/re-engagement flows when a purchase occurs"
},
{
"name": "Transition matrix documented",
"max_score": 8,
"description": "A transition-matrix document exists showing for each destination stage what workflow fires, including the from-stage condition for the second-purchase milestone and the lapsed win-back"
},
{
"name": "previousStage used in logic",
"max_score": 10,
"description": "The workflow trigger function accepts or uses the 'from' (previous) stage parameter to make conditional decisions — not just the destination stage alone"
}
]
}
Automated Marketing Workflow Triggers
Problem Description
Brewsmith, an online specialty coffee subscription service, has a customer lifecycle system that classifies customers into stages. Now they need to wire up the automation layer: whenever a customer moves from one stage to another, the right marketing workflow should fire automatically. The current system does nothing when customers transition — loyal customers receive no recognition, and at-risk customers churn silently without any intervention.
The growth team has documented the workflows they want triggered at each stage transition. The key requirements are:
- New subscribers should enter a short welcome sequence
- When someone makes their first purchase, they should exit the welcome sequence immediately (they've already converted) and enter a product onboarding flow
- When someone makes a second purchase, acknowledge the milestone
- Loyal customers deserve meaningful recognition — both an acknowledgment and some tangible benefit
- Customers who are slipping away need a gentle nudge — but the team does NOT want to immediately offer discounts to everyone who goes at-risk; discounts erode margins and should only be used as a last resort
- If a customer continues to lapse after already receiving a retention nudge, then a stronger win-back offer is appropriate
- Advocates who refer friends or leave reviews deserve exclusive perks
Additionally, the team wants to handle real-time purchase events properly: when a customer buys something, any active win-back or re-engagement flows should be cancelled immediately — there's nothing worse than receiving a "we miss you" email an hour after placing an order.
The system needs to be documented. Produce a transition matrix document that maps every possible stage transition to the workflow it triggers.
Output Specification
Write a TypeScript file workflow-triggers.ts containing the triggerStageTransitionWorkflow function and any supporting handlers (e.g. an onOrderPaid handler for real-time purchase events).
Also write a transition-matrix.md that documents: for each destination stage, which workflows fire and under what conditions (include the from-stage where it matters).
{
"name": "finsi/lifecycle-marketing-automation",
"version": "0.1.0",
"summary": "Map customer journey stages from first visit to loyal advocate with personalized messaging, triggered workflows, and segment-based campaign automation",
"skills": {
"lifecycle-marketing-automation": {
"path": "SKILL.md"
}
}
}