Build a AI Lead Scoring for Email Marketing — Behavioral Propensity Score & Auto-Segmentation Workflow with n8n

Your email list is a graveyard of untapped signals. Every open, every click, every quiet visit to your pricing page is a contact telling you exactly how ready they are to buy — and most teams blast th

Build a AI Lead Scoring for Email Marketing — Behavioral Propensity Score & Auto-Segmentation Workflow with n8n
Article written (~1,340 words). Here is the complete HTML: ```html

Your email list is a graveyard of untapped signals. Every open, every click, every quiet visit to your pricing page is a contact telling you exactly how ready they are to buy — and most teams blast the same sequence to all of them anyway. The result is predictable: hot leads get generic drip and go cold, dead contacts inflate your send volume and tank your deliverability, and nobody on your team has the hours to manually sort thousands of records into buckets every single day.

This article walks through a production-ready n8n workflow that fixes that. Every morning it reads the behavioral history of every contact, sends it to GPT-4o for a propensity score from 1 to 10, and writes back a cold / warm / hot segment into HubSpot and Mailchimp — so the right sequence reaches the right person without you touching a spreadsheet.

The problem: static lists in a behavioral world

Traditional lead scoring is a rules engine someone built 18 months ago and never revisited. "+10 for a click, +5 for an open, -3 for 30 days of silence." It's brittle. It can't weigh the difference between a contact who opened three newsletters out of boredom and one who opened one email, clicked the pricing link, and came back to the site twice in a week. Those two people have identical point totals and completely opposite intent.

The manual alternative is worse. Ops teams export a CSV, eyeball the engagement columns, and hand-tag segments — a process that is stale the moment it finishes and never scales past a few hundred contacts. Meanwhile the cost of getting it wrong compounds: mailbox providers watch engagement rates, and every send to a disengaged contact drags your sender reputation down, pushing even your hot leads toward the spam folder.

What you actually need is a scoring model that reads raw behavior the way a good SDR would, updates daily, and pushes its conclusions straight into the tools your sequences already run on. That's a job for an LLM on a schedule — which is exactly what n8n is built to orchestrate.

The solution: GPT-4o as a daily propensity engine

The workflow treats each contact as a small dossier of behavior — opens over the last 30 days, clicks, pages visited, recency, and total interactions — and asks GPT-4o a single, well-constrained question: on a scale of 1 to 10, how likely is this person to convert in the next 14 days? Because the model reasons over the pattern rather than a fixed point table, it naturally rewards recency and depth (a pricing-page visit outweighs ten opens) and penalizes staleness without you hardcoding a decay curve.

The score maps to three segments: 1–3 cold, 4–7 warm, 8–10 hot. Those segment labels are written back to HubSpot as a contact property and mirrored to a Mailchimp tag, so your existing automations — nurture for cold, education for warm, sales-touch for hot — fire against live intent instead of a snapshot from last quarter. Nothing about your downstream sequences has to change; you're just feeding them a smarter segment.

Step-by-step: building it in n8n

Here is the node-by-node structure of the workflow. It runs unattended and processes your entire list in a single pass each morning.

  1. Schedule Trigger — set to run daily at, say, 06:00. Use the Cron expression 0 6 * * * so scoring is fresh before your sequences send. Running before your ESP's morning batch means today's segment reflects yesterday's full behavior.
  2. HubSpot node (Get Many Contacts) — pull contacts with the properties you'll score on: email, hs_email_open, hs_email_click, hs_analytics_num_page_views, notes_last_contacted, and lastmodifieddate. Enable Return All and let n8n paginate. If your list is large, add a Limit and a Loop Over Items (SplitInBatches) node to stay under API rate limits.
  3. Set / Edit Fields node — flatten each contact into a compact behavior string, e.g. opens_30d: 8, clicks_30d: 3, page_views: 5, days_since_last_activity: 2. Keeping the payload lean cuts token cost and sharpens the model's focus.
  4. OpenAI node (Message a Model) — model gpt-4o. Set the temperature to 0.2 for stable, repeatable scores. In the system prompt, define the rubric: "You are a B2B lead-scoring analyst. Given behavioral signals, return strict JSON: {"score": <1-10>, "segment": "cold|warm|hot", "reason": "<10 words>"}. Weight recency and page visits above raw opens." Turn on JSON mode (Response Format → JSON) so the output parses cleanly.
  5. Code node (or Set node) — parse the model's JSON, validate the score is an integer 1–10, and derive the segment as a safety net in case the model returns an out-of-band value. Never trust the LLM's label blindly; clamp it against the numeric score.
  6. HubSpot node (Update Contact) — write ai_propensity_score and ai_segment back to the contact. Create these as custom properties in HubSpot first (a number and a dropdown-select).
  7. Mailchimp node (Add/Update Member Tags) — apply the matching tag (hot, warm, cold) and remove the other two so a contact never sits in two segments. Match members by the same email you scored on.
  8. NoOp / logging branch — optionally append each run to a Google Sheet or Postgres table so you can audit score drift and prove the model's calls over time.

Wire an Error Trigger workflow alongside it that pings Slack or email if a run fails — a silent scoring outage is worse than no scoring, because your sequences keep firing against yesterday's stale segments without anyone noticing.

The benefits: what changes once it's live

The first thing you'll feel is deliverability relief. Because cold contacts get pulled into a low-frequency re-engagement track instead of your main sends, your engagement rate per campaign climbs and mailbox providers reward you with better inbox placement — which lifts results for every segment, not just the hot one.

The second is sales efficiency. When "hot" means the model saw a pricing visit plus two clicks in the last 48 hours, your SDRs can work a short, high-intent list instead of dialing through a thousand cold names. Handing sales a daily-refreshed hot segment is often the single highest-leverage output of the whole workflow.

Third, it's genuinely hands-off. There is no weekly re-tagging ritual, no stale rules engine, no CSV surgery. The workflow runs at 6 AM, and by the time your team logs in the segments are already correct. And because the scoring logic lives in a prompt rather than buried in ESP settings, you can tune the rubric in thirty seconds when your ICP shifts — no re-platforming required.

Common pitfalls (and how to avoid them)

Sending raw PII to the model unnecessarily. The model needs behavior, not names and phone numbers. Strip your payload down to engagement signals before the OpenAI node — it's cheaper, faster, and keeps you clean on data governance.

Letting the LLM return free-form text. If you skip JSON mode and strict parsing, one chatty response ("This lead seems quite warm!") will break your update nodes. Always enforce a JSON schema and validate it in a Code node before writing anything back.

Ignoring API rate limits. HubSpot, Mailchimp, and OpenAI all throttle. On a list of thousands, run a Loop Over Items with a batch size of 20–50 and a small Wait node between batches. A single unbatched run against a 10,000-contact list will hit a 429 and die halfway through, leaving your segments in an inconsistent state.

Scoring the whole list every day when you don't need to. Once you're at scale, filter the HubSpot query to contacts modified in the last 24–48 hours (lastmodifieddate). Someone with zero new activity keeps yesterday's score — this cuts token spend dramatically without hurting accuracy.

Trusting the segment blindly. Log the model's reason field and spot-check twenty contacts a week for the first month. LLM scoring is excellent, but you want to catch prompt drift or a bad rubric before it quietly mis-routes your best leads.

Set this up once and it becomes invisible infrastructure: a quiet 6 AM job that turns raw behavioral noise into a clean, sales-ready segmentation your sequences can trust — every single day, without anyone lifting a finger.

AI Lead Scoring for Email Marketing — Behavioral Propensity Score & Auto-Segmentation
PRONTO PARA USAR

Ja construimos isso pra voce

Nao comece do zero. O AI Lead Scoring for Email Marketing — Behavioral Propensity Score & Auto-Segmentation e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.

Instalar por $49.0 →
```