How to Build a Lead Scoring System with AI and Klaviyo

Use AI to score leads based on behaviour and engagement, then sync scores to Klaviyo for targeted campaigns.

What This Integration Does

Lead scoring tells your campaigns where to spend attention. Hot leads deserve personal outreach; warm leads should see product recommendations; cold leads need a win-back. This workflow scores every customer based on purchase history, email engagement, and recency, then writes the score and tier back to Klaviyo as custom properties your segments and flows can use directly.

The workflow runs on a schedule (weekly by default) or on demand via webhook when significant activity happens. Each run pulls the latest behavioural data, sends it to the AI Agent with a clear scoring rubric, and upserts the resulting score plus tier onto the Klaviyo profile. Because the score lives on the profile, every Klaviyo segment and flow can read it without extra plumbing.

Prerequisites

  • A Klaviyo connection with profile read and write access.
  • A connection to your store of truth for purchases (shopify or woocommerce).
  • A written scoring rubric: what counts as hot, warm, cold; which signals matter most; thresholds for each tier.

Step 1: Schedule Trigger

Add a Trigger node set to Schedule. Weekly on Sunday night is a good default - it gives you fresh scores before Monday's send window. For higher-velocity businesses, run daily.

Step 2: Pull Profiles and Engagement

Add a Connector node on klaviyo with the list-profiles tool. Page through profiles updated since the last run. In parallel, add a Connector on shopify with list-orders (or woocommerce list-orders) for the same window. Use Parallel to run both lookups concurrently.

Step 3: Compute Features Per Profile

Wrap a Loop around each profile. Inside the loop, add a Transform node that produces:

  • orderCount over the last 365 days
  • lifetimeValue
  • daysSinceLastOrder
  • emailOpenRate and emailClickRate from the Klaviyo profile
  • averageOrderValue

These are the inputs the AI will reason over - keep them stable so scores are reproducible.

Step 4: AI Agent Scores the Lead

Add an AI Agent node with structured output:

{
  "score": "number (0-100)",
  "tier": "hot | warm | cold",
  "topSignals": ["string"],
  "recommendedAction": "string"
}

Prompt: Score this lead 0-100 using the rubric in the system prompt. Hot = 80+, warm = 40-79, cold = 0-39. Weight recency and lifetime value most heavily. Features: {{ features }}.

Step 5: Write Score Back to Klaviyo

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

  • lead_score: {{ ai.score }}
  • lead_tier: {{ ai.tier }}
  • lead_recommended_action: {{ ai.recommendedAction }}
  • lead_scored_at: timestamp

Optionally call add-profiles-to-list to push the profile onto a list named after its tier, so Klaviyo flows can listen on list membership.

Step 6: Use Scores in Klaviyo

Once scores are populated, build Klaviyo segments and flows that read them:

  • Hot leads (80+) - trigger a personal outreach flow with a sales team handoff.
  • Warm leads (40-79) - send product recommendation campaigns.
  • Cold leads (under 40) - enter a win-back sequence.

Tips

  • Re-score weekly to keep tiers current - customer behaviour drifts and a stale score is worse than no score.
  • Upload your scoring rubric to a Knowledge collection so the AI can read your specific business rules instead of guessing.
  • Start with the simplest possible rubric and refine. Even a basic score is more useful than no scoring at all.

Common Pitfalls

  • Score thrashing - if a customer flips between hot and warm every run, your features are too sensitive. Average over a 7-day window or require two consecutive runs to flip tier.
  • Missing engagement data - profiles with no email opens at all confuse the AI. Bucket those into a fixed unengaged tier before the AI step.
  • Klaviyo property type drift - if you start writing lead_score as a number, do not later write a string. Klaviyo infers types on first write.

Testing

Run the workflow manually against 5-10 profiles you already have an opinion on. The AI's topSignals output should explain its score in language that matches your gut. Tune the prompt until it does, then enable the schedule.

Learn More

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