Tutorial

How to Build a 12-Line Lead Scoring Rubric in n8n

An r/n8n post shipped a rubric-based lead scorer in 12 lines. Walk-through with Scavio enrichment for the missing fields.

An r/n8n post shipped a 12-line weighted scoring rubric inside a GPT prompt for a 220-person SaaS doing 120 leads/week. This walks the same pattern with a Scavio enrichment step for what the form doesn't capture.

Prerequisites

  • n8n (cloud or self-host)
  • OpenAI/Anthropic API key
  • Scavio API key
  • A working CRM webhook or form

Walkthrough

Step 1: Trigger on inbound form/CRM webhook

Catch lead payload.

Text
// n8n: Webhook node, POST receiver, returns 200 fast

Step 2: Enrich with Scavio: company size, recent news, role context

HTTP Request node before scoring.

Text
// HTTP node: POST https://api.scavio.dev/api/v1/search
// Body: { "query": "site:linkedin.com/company {{$json.company}}" }

Step 3: Compose the rubric in the LLM prompt

12 lines, weighted, explicit.

Text
// LLM node prompt:
// Score the lead 0-100 using ONLY this rubric.
// Title fit: 30 (VP/Dir/C-level = full, IC = 0)
// Industry match: 25 (logistics/transport/3PL = full)
// Company size: 20 (200-2000 employees = full)
// Intent signal in form: 15 (asked demo or pricing = full)
// Fit notes: 10 (anything in form indicating budget/timeline)
// Lead JSON: {{$json}}
// Enrichment: {{$node['Scavio'].json.organic_results.slice(0,3)}}

Step 4: Parse score + reason JSON

Force model to output JSON.

Text
// Add to prompt: Return ONLY { "score": <int>, "reason": "<one sentence>" }

Step 5: Route on score: hot to Slack, warm to drip, cold to nurture

Switch node by score band.

Text
// Switch: score>=70 -> Slack hot, 40-69 -> drip campaign, <40 -> nurture

Step 6: Write back to CRM with score + reason

Auditable trail.

Text
// HubSpot/Salesforce/Pipedrive node: update lead with score, reason, and timestamp

Python Example

Python
# Per-lead cost: 1 Scavio call + 1 LLM call + 1 CRM write = ~$0.01-0.04. 120 leads/week = under $5/week.

JavaScript Example

JavaScript
// n8n is the deliverable. The Python/JS equivalent is just translating the HTTP+LLM+CRM call sequence.

Expected Output

JSON
Inbound lead → score within 60 seconds → routed to right team → reason logged in CRM. Replaces ~15 hours/week of manual triage. The rubric IS the product; treat it like code (PR review, version, audit).

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

n8n (cloud or self-host). OpenAI/Anthropic API key. Scavio API key. A working CRM webhook or form. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

An r/n8n post shipped a rubric-based lead scorer in 12 lines. Walk-through with Scavio enrichment for the missing fields.