{
"name": "AgentForge - Lead Qualifier Agent",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "lead-qualifier",
"responseMode": "onReceived",
"options": {}
},
"id": "1a2b3c4d-0001-4000-8000-000000000001",
"name": "Webhook - New Lead",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [260, 300],
"webhookId": "agentforge-lead-qualifier"
},
{
"parameters": {
"jsCode": "// Normalize incoming lead fields from a form submission\nconst body = $INPUT.first().json.body || $INPUT.first().json;\n\nreturn [{\n json: {\n name: body.name || '',\n email: body.email || '',\n company: body.company || '',\n message: body.message || body.notes || '',\n budget: body.budget || 'unknown',\n source: body.source || 'website form',\n submitted_at: new Date().toISOString()\n }\n}];"
},
"id": "1a2b3c4d-0002-4000-8000-000000000002",
"name": "Normalize Lead Data",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [480, 300]
},
{
"parameters": {
"authentication": "predefinedCredentialType",
"nodeCredentialType": "openAiApi",
"resource": "chat",
"model": "gpt-4o-mini",
"messages": {
"values": [
{
"role": "system",
"content": "You are a lead qualification assistant. Score the lead from 1-10 based on the fields provided (higher = more likely to convert, based on budget clarity, message intent, and urgency signals). Respond ONLY in strict JSON with this shape: {\"score\": number, \"tier\": \"hot\" | \"warm\" | \"cold\", \"reason\": string}. Use tier=hot for score 8-10, warm for 4-7, cold for 1-3."
},
{
"role": "user",
"content": "=Name: {{ $JSON.name }}\nCompany: {{ $JSON.company }}\nBudget: {{ $JSON.budget }}\nMessage: {{ $JSON.message }}\nSource: {{ $JSON.source }}"
}
]
},
"options": {
"temperature": 0.2
}
},
"id": "1a2b3c4d-0003-4000-8000-000000000003",
"name": "AI - Score Lead",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1.3,
"position": [700, 300],
"credentials": {
"openAiApi": {
"id": "REPLACEWITHYOURCREDENTIALID",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"jsCode": "// Parse the AI's JSON response safely\nconst raw = $INPUT.first().json.message?.content || $INPUT.first().json.choices?.[0]?.message?.content || $INPUT.first().json.text || '{}';\nlet parsed;\ntry {\n parsed = JSON.parse(raw);\n} catch (e) {\n parsed = { score: 0, tier: 'cold', reason: 'Could not parse AI response' };\n}\n\nconst lead = $('Normalize Lead Data').first().json;\n\nreturn [{\n json: {\n ...lead,\n score: parsed.score,\n tier: parsed.tier,\n reason: parsed.reason\n }\n}];"
},
"id": "1a2b3c4d-0004-4000-8000-000000000004",
"name": "Parse AI Result",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [920, 300]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "cond-hot",
"leftValue": "={{ $JSON.tier }}",
"rightValue": "hot",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "1a2b3c4d-0005-4000-8000-000000000005",
"name": "Is Hot Lead?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [1140, 300]
},
{
"parameters": {
"authentication": "webhook",
"resource": "message",
"text": "=🔥 Hot Lead Alert\nName: {{ $JSON.name }}\nCompany: {{ $JSON.company }}\nScore: {{ $JSON.score }}/10\nReason: {{ $JSON.reason }}\nMessage: {{ $JSON.message }}",
"otherOptions": {}
},
"id": "1a2b3c4d-0006-4000-8000-000000000006",
"name": "Slack - Notify Hot Lead",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [1360, 200],
"credentials": {
"slackApi": {
"id": "REPLACEWITHYOURCREDENTIALID",
"name": "Slack account"
}
}
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"mode": "list",
"value": "REPLACEWITHYOURGOOGLESHEET_ID"
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "Leads"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"name": "={{ $JSON.name }}",
"email": "={{ $JSON.email }}",
"company": "={{ $JSON.company }}",
"score": "={{ $JSON.score }}",
"tier": "={{ $JSON.tier }}",
"reason": "={{ $JSON.reason }}",
"submittedat": "={{ $json.submittedat }}"
}
},
"options": {}
},
"id": "1a2b3c4d-0007-4000-8000-000000000007",
"name": "Log to Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [1360, 400],
"credentials": {
"googleSheetsOAuth2Api": {
"id": "REPLACEWITHYOURCREDENTIALID",
"name": "Google Sheets account"
}
}
}
],
"connections": {
"Webhook - New Lead": {
"main": [
[
{
"node": "Normalize Lead Data",
"type": "main",
"index": 0
}
]
]
},
"Normalize Lead Data": {
"main": [
[
{
"node": "AI - Score Lead",
"type": "main",
"index": 0
}
]
]
},
"AI - Score Lead": {
"main": [
[
{
"node": "Parse AI Result",
"type": "main",
"index": 0
}
]
]
},
"Parse AI Result": {
"main": [
[
{
"node": "Is Hot Lead?",
"type": "main",
"index": 0
}
]
]
},
"Is Hot Lead?": {
"main": [
[
{
"node": "Slack - Notify Hot Lead",
"type": "main",
"index": 0
},
{
"node": "Log to Google Sheet",
"type": "main",
"index": 0
}
],
[
{
"node": "Log to Google Sheet",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateId": "agentforge-lead-qualifier-v1"
}
}
AgentForge — Lead Qualifier Agent
==================================
Files in this package:
AgentForgeLeadQualifier.json → Import this into n8n (Workflows > Import from File)
Setup_Guide.pdf → Full step-by-step setup instructions
Quick start:
Open Setup_Guide.pdf and read "What This Does" and "Setup — Step by Step"
Import the .json file into your n8n instance
Connect your OpenAI, Slack, and Google Sheets accounts (see guide for exact steps)
Activate the workflow and point your lead form at the generated webhook URL
You need your own free/paid accounts for OpenAI, Slack, and Google Sheets —
this workflow connects to them but does not include them.
Questions? Reach out through the contact on the product page you purchased this from.
Thanks for buying — more AgentForge workflows are on the way.
