Tutorial

How to Build an n8n Lead Qualifier in 12 Lines

Build a complete lead qualification product in n8n where the scoring prompt is 12 lines. Webhook to CRM in under an hour.

An r/n8n post showed a lead qualifier where the scoring prompt is 12 lines and that is the whole product. This tutorial replicates it: webhook → enrich with search API → LLM score → route to CRM.

Prerequisites

  • n8n instance (cloud or self-hosted)
  • Scavio API key
  • LLM API key

Walkthrough

Step 1: Create webhook trigger

n8n webhook node receives lead data (company name, domain, industry).

JSON
// n8n Webhook node
// Method: POST
// Path: /qualify-lead
// Body: { company: 'Acme Corp', domain: 'acme.com', industry: 'SaaS' }

Step 2: Enrich with Scavio

HTTP Request node calls Scavio to get company context.

JSON
// n8n HTTP Request node
// URL: https://api.scavio.dev/api/v1/search
// Method: POST
// Headers: x-api-key: {{$env.SCAVIO_API_KEY}}
// Body: { platform: 'google', query: '{{$json.company}} {{$json.industry}} reviews' }

Step 3: Score with 12-line prompt

OpenAI/Anthropic node scores the lead 1-10.

Text
Score this lead 1-10 based on:
- Company has clear budget signals (job posts, funding)
- Industry matches our ICP
- Company size suggests decision-making speed
- Online presence indicates tech-savviness
- Reddit/forum mentions suggest active community
- Recent news suggests growth or pain

Company: {{company}}
Context: {{enrichment_data}}

Return only: {score: N, reason: 'one sentence'}

Step 4: Route by score

Switch node routes: 8-10 → hot lead, 5-7 → nurture, 1-4 → archive.

Text
// n8n Switch node
// Condition 1: score >= 8 → Hot Leads (CRM)
// Condition 2: score >= 5 → Nurture (email sequence)
// Default: Archive

Step 5: Push to CRM

HTTP Request or native integration to your CRM.

Text
// n8n HTTP Request to CRM API
// Or native HubSpot/Pipedrive/Salesforce node

Python Example

Python
# The n8n workflow is no-code. Python equivalent:
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def qualify_lead(company, industry):
    context = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
        json={'platform': 'google', 'query': f'{company} {industry} reviews'}).json()
    # LLM scores using the 12-line prompt
    # Route based on score

JavaScript Example

JavaScript
// n8n workflow is no-code. Same logic applies in JS.

Expected Output

JSON
n8n workflow: webhook → Scavio enrich → LLM score (12-line prompt) → route to CRM. Total enrichment cost: ~$0.01/lead.

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 instance (cloud or self-hosted). Scavio API key. LLM API key. 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

Build a complete lead qualification product in n8n where the scoring prompt is 12 lines. Webhook to CRM in under an hour.