This workflow corresponds to n8n.io template #13421 — we link there as the canonical source.
This workflow follows the Chainllm → Form Trigger recipe pattern — see all workflows that pair these two integrations.
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 →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "aba8b75a-6c5a-4d19-ab32-5fe7cbd557c6",
"name": "Workflow Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
-464,
752
],
"parameters": {
"width": 540,
"height": 752,
"content": "## \ud83d\udcb0 AI Revenue Intelligence: 360\u00b0 Customer Journey Automation\n\nThis workflow automates lead capture, AI-powered scoring, revenue prediction, and sales team notifications using Google Gemini AI.\n\n### How it works\n1. Sales lead submits information via web form\n2. Lead data is processed and normalized\n3. External API enriches lead profile data\n4. AI analyzes purchase intent and scores the lead\n5. AI scoring is parsed and leads are routed by quality\n6. AI predicts revenue potential and sales cycle\n7. Results are logged to dashboard and teams are notified\n\n### Setup steps\n1. Configure Google Gemini API credentials\n2. Set up Google Sheets for revenue dashboard\n3. Configure Slack for sales team alerts\n4. Set up Gmail for lead report delivery\n5. Activate the workflow\n\n### Key features\n- \ud83d\udccb Web form for lead capture\n- \ud83e\udd16 AI-powered lead scoring with Gemini\n- \ud83d\udd0d External data enrichment via API\n- \ud83d\udcc8 Predictive revenue analytics\n- \ud83d\udd14 Real-time Slack alerts for hot leads\n- \ud83d\udce7 Automated lead report emails\n\n\u26a0\ufe0f **Note:** This workflow requires valid API credentials for Google Gemini, Google Sheets, Slack, and Gmail."
},
"typeVersion": 1
},
{
"id": "9d52e9a8-89cb-4dfb-9b8d-add1f6e1216c",
"name": "Step 1 - Lead Capture",
"type": "n8n-nodes-base.stickyNote",
"position": [
96,
752
],
"parameters": {
"color": 7,
"width": 820,
"height": 508,
"content": "### \ud83d\udce5 Step 1 - Lead Capture & Enrichment\nLead submits details via web form. Data is processed and enriched with external API data."
},
"typeVersion": 1
},
{
"id": "9b78e016-f605-477d-af7c-bc26961f4a1a",
"name": "Step 2 - AI Analysis",
"type": "n8n-nodes-base.stickyNote",
"position": [
944,
752
],
"parameters": {
"color": 7,
"width": 420,
"height": 504,
"content": "### \ud83e\udd16 Step 2 - AI Analysis & Scoring\nGoogle Gemini AI analyzes purchase intent, scores the lead, and recommends next actions."
},
"typeVersion": 1
},
{
"id": "6eefe50a-a250-4251-a9e9-ca98a104b52a",
"name": "Step 3 - Prediction & Routing",
"type": "n8n-nodes-base.stickyNote",
"position": [
1376,
752
],
"parameters": {
"color": 7,
"width": 540,
"height": 508,
"content": "### \ud83d\udcca Step 3 - Revenue Prediction & Routing\nAI scoring is parsed, leads are routed by quality, and revenue is predicted."
},
"typeVersion": 1
},
{
"id": "e67af1e6-bd1a-4c19-b054-ea43c77b3411",
"name": "Step 4 - CRM & Notifications",
"type": "n8n-nodes-base.stickyNote",
"position": [
1936,
752
],
"parameters": {
"color": 7,
"width": 960,
"height": 568,
"content": "### \ud83d\udce7 Step 4 - CRM Update & Notifications\nLeads are logged to Google Sheets dashboard, hot leads trigger Slack alerts, and reports are emailed."
},
"typeVersion": 1
},
{
"id": "d4d3045b-8931-45f9-9c9e-c805b09b82ed",
"name": "Lead Capture Form",
"type": "n8n-nodes-base.formTrigger",
"position": [
128,
960
],
"parameters": {
"path": "c6eaeba6-e2e3-4bee-a954-a80948c3df15",
"options": {},
"formFields": {
"values": [
{
"fieldType": "string",
"fieldLabel": "Company Name",
"placeholder": "e.g., TechCorp Inc.",
"requiredField": true
},
{
"fieldType": "string",
"fieldLabel": "Contact Email",
"placeholder": "e.g., user@example.com",
"requiredField": true
},
{
"fieldType": "dropdown",
"fieldLabel": "Industry",
"fieldOptions": {
"values": [
{
"option": "Technology"
},
{
"option": "Healthcare"
},
{
"option": "Finance"
},
{
"option": "Retail"
},
{
"option": "Manufacturing"
},
{
"option": "Education"
},
{
"option": "Other"
}
]
},
"requiredField": true
},
{
"fieldType": "string",
"fieldLabel": "Estimated Budget",
"placeholder": "e.g., 50000",
"requiredField": true
},
{
"fieldType": "string",
"fieldLabel": "Needs Description",
"placeholder": "Describe what the prospect is looking for...",
"requiredField": true
}
]
}
},
"typeVersion": 2.1
},
{
"id": "4dfba62b-35a3-4e8f-a3f9-1a3b48888865",
"name": "Process Lead Data",
"type": "n8n-nodes-base.code",
"position": [
416,
960
],
"parameters": {
"jsCode": "// Process Lead Data - Normalize and generate slug\nconst items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const companyName = (item.json['Company Name'] || '').trim();\n const email = (item.json['Contact Email'] || '').trim().toLowerCase();\n const industry = item.json['Industry'] || 'Other';\n const rawBudget = (item.json['Estimated Budget'] || '0').toString().replace(/[^0-9.]/g, '');\n const budget = parseFloat(rawBudget) || 0;\n const needs = (item.json['Needs Description'] || '').trim();\n \n // Generate company slug\n const slug = companyName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');\n \n // Extract email domain\n const emailDomain = email.split('@')[1] || '';\n \n results.push({\n json: {\n companyName,\n companySlug: slug,\n contactEmail: email,\n emailDomain,\n industry,\n budget,\n budgetFormatted: `$${budget.toLocaleString('en-US', { minimumFractionDigits: 2 })}`,\n budgetTier: budget >= 100000 ? 'Enterprise' : budget >= 25000 ? 'Mid-Market' : 'SMB',\n needs,\n capturedAt: new Date().toISOString(),\n leadId: `LEAD-${Date.now()}-${Math.random().toString(36).substr(2, 6).toUpperCase()}`\n }\n });\n}\n\nreturn results;"
},
"typeVersion": 2
},
{
"id": "3d08907a-0276-463b-88e3-4d79e946d929",
"name": "Enrich Lead Data",
"type": "n8n-nodes-base.httpRequest",
"position": [
688,
960
],
"parameters": {
"url": "=https://api.company-enrichment.example.com/v1/lookup?domain={{ $json.emailDomain }}",
"options": {
"timeout": 10000
}
},
"typeVersion": 4.2
},
{
"id": "32f95dd9-5587-4374-9fd4-2b21a19265de",
"name": "AI Lead Analyzer",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1008,
960
],
"parameters": {},
"typeVersion": 1.4
},
{
"id": "53e75807-3950-43ae-8330-e439718d780d",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1008,
1120
],
"parameters": {
"options": {
"temperature": 0.3
},
"modelName": "models/gemini-1.5-flash"
},
"typeVersion": 1
},
{
"id": "c7e1884e-7ff1-4860-8bf2-6f44368aee79",
"name": "Parse AI Scoring",
"type": "n8n-nodes-base.code",
"position": [
1424,
960
],
"parameters": {
"jsCode": "// Parse AI Scoring - Extract structured scoring data\nconst items = $input.all();\nconst results = [];\n\nfor (const item of items) {\n const aiText = item.json.text || item.json.response || JSON.stringify(item.json);\n let scoring = {};\n \n try {\n const jsonMatch = aiText.match(/\\{[\\s\\S]*\\}/);\n if (jsonMatch) {\n scoring = JSON.parse(jsonMatch[0]);\n }\n } catch (e) {\n scoring = {\n leadScore: 50,\n purchaseIntent: 'medium',\n buyerPersona: 'Unknown',\n painPoints: ['Unable to parse AI response'],\n recommendedActions: ['Manual qualification required'],\n competitivePosition: 'Unknown',\n dealProbability: 50,\n estimatedDealSize: 'Unknown',\n summary: 'AI scoring could not be parsed. Manual review required.'\n };\n }\n \n const leadScore = parseInt(scoring.leadScore) || 50;\n const isHotLead = leadScore >= 70;\n const leadData = $('Process Lead Data').first().json;\n \n results.push({\n json: {\n ...leadData,\n leadScore,\n isHotLead,\n leadGrade: leadScore >= 80 ? 'A' : leadScore >= 60 ? 'B' : leadScore >= 40 ? 'C' : 'D',\n purchaseIntent: scoring.purchaseIntent || 'medium',\n buyerPersona: scoring.buyerPersona || 'Unknown',\n painPoints: scoring.painPoints || [],\n recommendedActions: scoring.recommendedActions || [],\n competitivePosition: scoring.competitivePosition || 'Unknown',\n dealProbability: scoring.dealProbability || 50,\n estimatedDealSize: scoring.estimatedDealSize || 'Unknown',\n aiSummary: scoring.summary || 'No summary available',\n scoredAt: new Date().toISOString()\n }\n });\n}\n\nreturn results;"
},
"typeVersion": 2
},
{
"id": "cf273a9d-70f3-4c30-b799-1bed21c00a4d",
"name": "Lead Quality Router",
"type": "n8n-nodes-base.if",
"position": [
1680,
960
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "lead-quality-001",
"operator": {
"type": "number",
"operation": "gte"
},
"leftValue": "={{ $json.leadScore }}",
"rightValue": 70
}
]
}
},
"typeVersion": 2
},
{
"id": "b54674a1-5e91-4fdb-b5cc-b93ab7907e7b",
"name": "Revenue Predictor",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
2000,
960
],
"parameters": {},
"typeVersion": 1.4
},
{
"id": "f5e2f4b2-4912-4aa9-8520-21e6a4d85b6b",
"name": "Google Gemini Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
2000,
1168
],
"parameters": {
"options": {
"temperature": 0.4
},
"modelName": "models/gemini-1.5-flash"
},
"typeVersion": 1
},
{
"id": "86bb60e8-66e7-47a5-a664-1e964596745d",
"name": "Update Revenue Dashboard",
"type": "n8n-nodes-base.googleSheets",
"position": [
2288,
960
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.5
},
{
"id": "53d005e0-f76a-4463-8242-9dae247dbacc",
"name": "Sales Team Alert",
"type": "n8n-nodes-base.slack",
"position": [
2000,
816
],
"parameters": {
"text": "=\ud83d\udd25 *HOT LEAD ALERT*\n\n*Lead ID:* {{ $json.leadId }}\n*Company:* {{ $json.companyName }}\n*Industry:* {{ $json.industry }}\n*Budget:* {{ $json.budgetFormatted }}\n*Lead Score:* {{ $json.leadScore }}/100 (Grade {{ $json.leadGrade }})\n*Purchase Intent:* {{ $json.purchaseIntent }}\n*Deal Probability:* {{ $json.dealProbability }}%\n\n*AI Summary:* {{ $json.aiSummary }}\n\n*Recommended Actions:*\n{{ $json.recommendedActions.join('\\n\u2022 ') }}\n\n\ud83d\ude80 Follow up immediately!",
"otherOptions": {}
},
"typeVersion": 2.2
},
{
"id": "373430e2-bd56-468f-9df0-b2c544752d59",
"name": "Send Lead Report",
"type": "n8n-nodes-base.gmail",
"position": [
2688,
960
],
"parameters": {
"message": "=<h2>\ud83d\udcc8 Revenue Intelligence Report</h2><p><strong>Lead ID:</strong> {{ $json.leadId }}<br><strong>Company:</strong> {{ $json.companyName }}<br><strong>Industry:</strong> {{ $json.industry }}<br><strong>Budget:</strong> {{ $json.budgetFormatted }}<br><strong>Lead Score:</strong> {{ $json.leadScore }}/100 (Grade {{ $json.leadGrade }})<br><strong>Purchase Intent:</strong> {{ $json.purchaseIntent }}<br><strong>Deal Probability:</strong> {{ $json.dealProbability }}%</p><h3>AI Analysis</h3><p>{{ $json.aiSummary }}</p><h3>Recommended Actions</h3><ul>{{ $json.recommendedActions.map(a => '<li>' + a + '</li>').join('') }}</ul>",
"options": {},
"subject": "=Lead Report: {{ $json.companyName }} (Score: {{ $json.leadScore }}) "
},
"typeVersion": 2.1
}
],
"connections": {
"AI Lead Analyzer": {
"main": [
[
{
"node": "Parse AI Scoring",
"type": "main",
"index": 0
}
]
]
},
"Enrich Lead Data": {
"main": [
[
{
"node": "AI Lead Analyzer",
"type": "main",
"index": 0
}
]
]
},
"Parse AI Scoring": {
"main": [
[
{
"node": "Lead Quality Router",
"type": "main",
"index": 0
}
]
]
},
"Lead Capture Form": {
"main": [
[
{
"node": "Process Lead Data",
"type": "main",
"index": 0
}
]
]
},
"Process Lead Data": {
"main": [
[
{
"node": "Enrich Lead Data",
"type": "main",
"index": 0
}
]
]
},
"Revenue Predictor": {
"main": [
[
{
"node": "Send Lead Report",
"type": "main",
"index": 0
}
]
]
},
"Lead Quality Router": {
"main": [
[
{
"node": "Revenue Predictor",
"type": "main",
"index": 0
},
{
"node": "Sales Team Alert",
"type": "main",
"index": 0
},
{
"node": "Update Revenue Dashboard",
"type": "main",
"index": 0
}
],
[
{
"node": "Update Revenue Dashboard",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Lead Analyzer",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "Revenue Predictor",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Transform your sales pipeline with this comprehensive AI-powered platform that automates lead capture, scoring, revenue prediction, and sales team coordination. Perfect for B2B teams processing 50+ leads weekly.
Source: https://n8n.io/workflows/13421/ — 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.
Automate your lead intake, scoring, and outreach pipeline. This workflow collects leads from forms, enriches and scores them using Relevance AI, routes them by quality, and triggers the right follow-u
Sales teams and B2B marketers who spend hours researching leads manually. If you've looked at Clay but didn't want the $149/month price tag, this workflow does the same job as a one-time n8n template.
This workflow automates B2B lead research for Japanese companies. Submit a company name through a web form, and the workflow queries two free Japanese government APIs for corporate registry and busine
> Transform your content ideas into viral Facebook posts with AI-powered automation in just 30 minutes!
This workflow automates invoice processing and cash flow prediction by combining Google Gemini AI with form-based invoice capture, fraud detection, and financial reporting.