How to Build a Win-Back Email Campaign with Klaviyo and AI

Use AI to create personalized win-back emails for lapsed customers.

What This Integration Does

Generic "we miss you" emails get ignored. This workflow finds customers who have gone quiet, asks the AI Agent to write a message that references what they actually bought before, and pushes that message into Klaviyo so a flow can deliver it. The result is win-back emails that read like a human wrote them, sent at the right cadence, with no manual work per customer.

The workflow runs on a weekly schedule. It pulls the list of lapsed customers (no orders in 90+ days), generates a personalized message per customer, stores it on the Klaviyo profile as a custom property, then fires an event that triggers the win-back flow. The Klaviyo email template just reads the custom property, so the same flow works for everybody but every recipient sees a different message.

Prerequisites

  • A Klaviyo connection with profile read/write and event write access.
  • A Shopify or WooCommerce connection for purchase history.
  • A Klaviyo flow that listens on a Winback Triggered event and renders an email template that references the custom property.
  • A target list of "lapsed" customers (90 days since last order is the default).

Step 1: Weekly Schedule Trigger

Add a Trigger node set to Schedule. Weekly on Tuesday 10:00 is a good default - mid-week, mid-morning, when open rates tend to be highest.

Step 2: Find Lapsed Customers

Add a Connector node on shopify with the list-customers tool (or woocommerce list-customers). Filter to customers whose last order is older than 90 days. To bound the volume, also exclude customers who already received a win-back in the last 30 days - track this in a mongodb collection.

Step 3: Fetch Their Order History

Wrap a Loop around each lapsed customer. Inside, add a Connector node on shopify using list-orders filtered by customer id. The AI needs to know what the customer bought to write something specific to them.

Step 4: AI Agent Writes the Win-Back

Add an AI Agent node with structured output:

{
  "subjectLine": "string",
  "preheader": "string",
  "bodyHtml": "string",
  "offerType": "discount | free-shipping | new-product | no-offer",
  "offerCode": "string | null"
}

Prompt: Write a short, warm win-back email for {{ customer.firstName }}, who last bought {{ orders[0].lineItems[0].title }} on {{ orders[0].createdAt }}. Mention the product they bought. Do not be guilt-trippy. Keep subject under 50 characters. Pick the offer type that best fits a {{ orders.length }}-order customer.

Step 5: Push Copy to Klaviyo

Add a Connector node on klaviyo using update-profile. Set:

  • winback_subject
  • winback_preheader
  • winback_body_html
  • winback_offer_type
  • winback_offer_code
  • winback_generated_at

Step 6: Trigger the Klaviyo Flow

Add a final Connector node on klaviyo using create-event:

  • metric: Winback Triggered
  • profile: { "email": "{{ customer.email }}" }
  • unique_id: a hash of (customer id + this week)

Inside Klaviyo, the flow listening on Winback Triggered reads the custom properties and renders the email. After the loop, log the run to mongodb so next week's job knows to skip these customers.

Tips

  • Cap one win-back per customer per 30 days. Repeated reactivation attempts are the fastest way to earn spam complaints.
  • Tier the offer by lifetime value - past VIPs get a real discount, low-LTV customers get free shipping or no offer.
  • Always include a one-click unsubscribe. Lapsed customers are the most likely to mark you spam.

Common Pitfalls

  • Defining "lapsed" wrong - 90 days is right for high-frequency categories like beauty, but luxury or B2B may need 180 or 365. Pick a threshold that matches your actual repeat curve.
  • Generic AI output - if the prompt does not constrain the AI to reference real purchase data, you get vanilla copy. Always pass orders[0] into the prompt explicitly.
  • Customers who unsubscribed - filter out profiles where accepts_marketing is false before scheduling the send.

Testing

Run the workflow manually against a single hand-picked lapsed customer (use your own profile, marked as lapsed in a test environment). Confirm Klaviyo shows the custom properties populated and the flow fires. Send yourself the email as a preview before turning the schedule on.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.