The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "CRM Lead Enrichment Router",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "crm-lead-router",
"responseMode": "responseNode",
"options": {}
},
"id": "07-webhook-trigger",
"name": "Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-900,
0
]
},
{
"parameters": {
"jsCode": "const body = $json.body || $json;\nreturn [{ json: { lead: { name: String(body.name || '').trim(), email: String(body.email || '').trim().toLowerCase(), company: String(body.company || '').trim(), country: String(body.country || '').trim(), budget: Number(body.budget || 0), interest: String(body.interest || '').trim().toLowerCase(), source: String(body.source || '').trim().toLowerCase() } } }];"
},
"id": "07-normalize-lead-data",
"name": "Normalize Lead Data",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-660,
0
]
},
{
"parameters": {
"jsCode": "const required = ['name', 'email', 'company', 'country', 'interest', 'source'];\nconst missing = required.filter((field) => !$json.lead[field]);\nif (missing.length) {\n return [{ json: { ok: false, statusCode: 400, error: `Missing required fields: ${missing.join(', ')}`, lead: $json.lead } }];\n}\nreturn [{ json: { ok: true, lead: $json.lead } }];"
},
"id": "07-validate-required-fields",
"name": "Validate Required Fields",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-420,
0
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$json.ok}}",
"value2": true
}
]
}
},
"id": "07-lead-valid",
"name": "Lead Valid?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
-180,
0
]
},
{
"parameters": {
"jsCode": "return [{ json: { ...$json, enrichment: { company_size: 'unknown', note: 'Replace with safe enrichment source if needed.' } } }];"
},
"id": "07-optional-enrichment-placeholder",
"name": "Optional Enrichment Placeholder",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
60,
-120
]
},
{
"parameters": {
"jsCode": "const lead = $json.lead;\nlet score = 0;\nif (lead.budget >= 10000) score += 40; else if (lead.budget >= 3000) score += 25;\nif (!/(gmail|yahoo|outlook|hotmail)\\.com$/.test(lead.email)) score += 20;\nif (/automation|integration|workflow|crm/.test(lead.interest)) score += 20;\nif (['website-form', 'referral'].includes(lead.source)) score += 5;\nconst classification = score >= 70 ? 'hot' : score >= 40 ? 'warm' : 'cold';\nreturn [{ json: { ...$json, score, classification } }];"
},
"id": "07-score-lead",
"name": "Score Lead",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
-120
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"conditions": [
{
"leftValue": "={{$json.classification}}",
"rightValue": "hot",
"operator": {
"type": "string",
"operation": "equals"
}
}
]
},
"renameOutput": true,
"outputKey": "hot"
},
{
"conditions": {
"conditions": [
{
"leftValue": "={{$json.classification}}",
"rightValue": "warm",
"operator": {
"type": "string",
"operation": "equals"
}
}
]
},
"renameOutput": true,
"outputKey": "warm"
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"id": "07-route-lead",
"name": "Route Lead",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
540,
-120
]
},
{
"parameters": {
"jsCode": "return [{ json: { ok: true, lead: $json.lead, score: $json.score, classification: 'hot', route: 'sales_priority_queue' } }];"
},
"id": "07-route-hot-lead",
"name": "Route Hot Lead",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
780,
-280
]
},
{
"parameters": {
"jsCode": "return [{ json: { ok: true, lead: $json.lead, score: $json.score, classification: 'warm', route: 'nurture_queue' } }];"
},
"id": "07-route-warm-lead",
"name": "Route Warm Lead",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
780,
-120
]
},
{
"parameters": {
"jsCode": "return [{ json: { ok: true, lead: $json.lead, score: $json.score, classification: 'cold', route: 'low_priority_queue' } }];"
},
"id": "07-route-cold-lead",
"name": "Route Cold Lead",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
780,
60
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{$json}}",
"options": {
"responseCode": "={{$json.statusCode || 200}}"
}
},
"id": "07-return-structured-response",
"name": "Return Structured Response",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1040,
0
]
}
],
"connections": {
"Webhook Trigger": {
"main": [
[
{
"node": "Normalize Lead Data",
"type": "main",
"index": 0
}
]
]
},
"Normalize Lead Data": {
"main": [
[
{
"node": "Validate Required Fields",
"type": "main",
"index": 0
}
]
]
},
"Validate Required Fields": {
"main": [
[
{
"node": "Lead Valid?",
"type": "main",
"index": 0
}
]
]
},
"Lead Valid?": {
"main": [
[
{
"node": "Optional Enrichment Placeholder",
"type": "main",
"index": 0
}
],
[
{
"node": "Return Structured Response",
"type": "main",
"index": 0
}
]
]
},
"Optional Enrichment Placeholder": {
"main": [
[
{
"node": "Score Lead",
"type": "main",
"index": 0
}
]
]
},
"Score Lead": {
"main": [
[
{
"node": "Route Lead",
"type": "main",
"index": 0
}
]
]
},
"Route Lead": {
"main": [
[
{
"node": "Route Hot Lead",
"type": "main",
"index": 0
}
],
[
{
"node": "Route Warm Lead",
"type": "main",
"index": 0
}
],
[
{
"node": "Route Cold Lead",
"type": "main",
"index": 0
}
]
]
},
"Route Hot Lead": {
"main": [
[
{
"node": "Return Structured Response",
"type": "main",
"index": 0
}
]
]
},
"Route Warm Lead": {
"main": [
[
{
"node": "Return Structured Response",
"type": "main",
"index": 0
}
]
]
},
"Route Cold Lead": {
"main": [
[
{
"node": "Return Structured Response",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"versionId": "placeholder-07"
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
CRM Lead Enrichment Router. Webhook trigger; 11 nodes.
Source: https://github.com/gharisj3/n8n-workflow-library/blob/main/workflows/07-crm-lead-enrichment-router/workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates bulk email campaigns with built-in validation, deliverability protection, and smart send-time optimization.
Who is this for? Solo founders, sales teams, and event organizers who need email outreach without expensive tools but want full control from Telegram.
This workflow is designed to manage the assignment and validation of unique QR code coupons within a lead generation system with SuiteCRM.
This workflow acts as an instant SDR that replies to new inbound leads across multiple channels in real time. It first captures and normalizes all incoming lead data into a unified structure. The work
AI Lead Qualification & Roting System. Uses httpRequest, twilio, airtable. Webhook trigger; 26 nodes.