n8n: Lead Scoring Workflow
Scores incoming leads from a webhook, applies rules, and routes hot leads to Slack.
Template
{
"name": "Lead Scoring Workflow",
"nodes": [
{
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [250, 300],
"parameters": {
"httpMethod": "POST",
"path": "lead-score",
"responseMode": "onReceived"
}
},
{
"name": "Score Lead",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [450, 300],
"parameters": {
"jsCode": "const lead = items[0].json.body || {}; let score = 0; if (lead.company_size > 50) score += 3; if (lead.company_size > 200) score += 2; if (['cto','vp','director','head'].some(r => (lead.role || '').toLowerCase().includes(r))) score += 3; if (lead.budget && lead.budget > 10000) score += 2; if (lead.source === 'referral') score += 2; return [{ json: { ...lead, score, tier: score >= 7 ? 'hot' : score >= 4 ? 'warm' : 'cold' } }];"
}
},
{
"name": "Is Hot Lead?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [650, 300],
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.score }}",
"operation": "largerEqual",
"value2": 7
}
]
}
}
},
{
"name": "Notify Sales",
"type": "n8n-nodes-base.slack",
"typeVersion": 2,
"position": [850, 200],
"parameters": {
"resource": "message",
"operation": "post",
"channel": "#sales-leads",
"text": "={{ ':fire: *Hot lead!* Score: ' + $json.score + '/10\n' + $json.name + ' (' + $json.role + ' at ' + $json.company + ')\nBudget: $' + ($json.budget || 'N/A') }}"
}
},
{
"name": "Log to API",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 3,
"position": [850, 400],
"parameters": {
"method": "POST",
"url": "https://your-crm.example.com/api/leads",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify($json) }}"
}
}
],
"connections": {
"Webhook": { "main": [[{ "node": "Score Lead" }]] },
"Score Lead": { "main": [[{ "node": "Is Hot Lead?" }]] },
"Is Hot Lead?": { "main": [[{ "node": "Notify Sales" }], [{ "node": "Log to API" }]] }
},
"active": false,
"settings": {}
}Setup
- 1
Copy the workflow JSON above.
- 2
In n8n, go to Workflows and click Import.
- 3
Paste the JSON and update credential references.
- 4
Activate the workflow.
Import into n8n
This is an n8n workflow. Import it directly into your n8n instance.
- 1
Open your n8n instance (localhost:5678 or your cloud URL).
- 2
Go to Workflows and click the + New button.
- 3
Click the three-dot menu in the top right, then select "Import from JSON".
- 4
Paste the workflow JSON from the template above.
- 5
Update any placeholder values (channel names, webhook URLs, credentials).
- 6
Activate the workflow with the toggle in the top right.
# Alternatively, import via n8n CLI:
n8n import:workflow --input=workflow.jsonVersion History
Framework
N8nRequirements
File type
Version
Updated Mar 16, 2026
You might also like
Client Onboarding
Track new client setup tasks. Send reminders until everything is done.
~$0.20/day · ~10 min setup
Invoice Tracker
Track sent invoices. Alert on overdue payments.
~$0.10/day · ~5 min setup
Lead Qualifier
Score inbound leads from form submissions. Route hot leads immediately.
~$0.30/day · ~10 min setup