AI-Powered Lead Intelligence Pipeline
The workflow ingests global industry news through structured data ingestion, runs each article through a Gemini-powered prompt evaluation matrix that I designed to filter out corporate noise like M&A announcements and HR updates, and extracts only signals with genuine physical operational relevance. From there a semantic routing layer built with a second Gemini call autonomously categorises qualified leads into specific industry verticals like Renewables and Mining without any manual intervention. I wrote custom JavaScript to simulate an Apollo.io executive profile enrichment integration, used a Split Out node to flatten nested JSON payloads into a clean 2D structure, and mapped everything into a structured Google Sheets CRM database using dynamic n8n expressions so that every row that lands in the sheet is sales-ready with no cleanup required. Earlier versions of this workflow used a simpler RSS ingestion approach and brittle Switch logic for routing. The current version replaced all of that with semantic AI routing which is significantly more robust and flexible.
Shared 5/4/2026
7 views
Visual Workflow
JSON Code
{
"id": "EyydojhsoQJ1wcRm",
"meta": {
"instanceId": "1a8db81ada829b66d05654eb5cb08e6b96ee89a188b9c6b1ccd5251c55de6123",
"templateCredsSetupCompleted": true
},
"name": "Fytbase Demo",
"tags": [],
"nodes": [
{
"id": "0fc52e60-04a0-4d83-8e93-452f4b4c2a91",
"name": "When clicking ‘Execute workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "2d328f03-098b-47db-aa26-ac0cb0fc195b",
"name": "RSS Read",
"type": "n8n-nodes-base.rssFeedRead",
"position": [
224,
-144
],
"parameters": {
"url": "https://www.oedigital.com/rss",
"options": {}
},
"typeVersion": 1.2
},
{
"id": "5cbd0aa1-8e0d-43cd-bcd5-67c9baeb6cf1",
"name": "Apollo Enrichment Engine ",
"type": "n8n-nodes-base.httpRequest",
"position": [
1408,
-176
],
"parameters": {
"url": "https://api.apollo.io/v1/mixed_people/search",
"method": "POST",
"options": {},
"jsonBody": "={\n \"q_organization_domains\": \"{{ $json['Case Study'].toLowerCase() }}.com\",\n \"person_titles\": [\n \"Director of Operations\",\n \"Head of Site Safety\",\n \"Offshore Installation Manager\"\n ]\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Cache-Control",
"value": "no-cahce"
},
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "X-Api-Key ",
"value": "tjjmhn2-ldBH1rERAILqtQ"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "86f08667-241e-4c2a-a246-0da373850335",
"name": "Mock Data Scrape ",
"type": "n8n-nodes-base.code",
"position": [
224,
0
],
"parameters": {
"jsCode": "return [\n\n {\n json: {\n title: \"Equinor reports micro-fractures in North Sea offshore wind turbine blades.\",\n text: \"Engineers warn that harsh maritime winds are accelerating wear on the outer resin layers. Routine visual inspections are currently delayed due to dangerous sea conditions and the high risk of deploying human climbing teams.\"\n }\n },\n \n\n {\n json: {\n title: \"Shell announces strategic acquisition of regional European EV charging network.\",\n text: \"The multi-billion dollar buyout is part of the energy giant's pivot towards green mobility. The transition will require significant corporate restructuring and the merging of financial compliance departments over the next two years.\"\n }\n },\n\n\n {\n json: {\n title: \"Anglo American halts operations at remote copper mine after seismic anomaly detected.\",\n text: \"Safety protocols require a full structural integrity scan of the high-wall pit and surrounding tailings dam before miners can return. The steep, unstable terrain makes ground-level surveying extremely hazardous.\"\n }\n },\n\n \n {\n json: {\n title: \"BP updates global employee health and safety training portal with AI modules.\",\n text: \"The new software rollout aims to standardize digital onboarding and compliance tracking for thousands of office workers and field engineers across their global headquarters.\"\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "cdad17a5-9815-483b-803e-6ecf8e6a59d2",
"name": "AI Qualifier",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
448,
0
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-flash-lite-latest",
"cachedResultName": "models/gemini-flash-lite-latest"
},
"options": {},
"messages": {
"values": [
{
"content": "=Role: You are an elite Technical Sales Engineer at FlytBase (an autonomous drone inspection platform). Your job is to aggressively filter incoming news alerts to protect the SDR team's time.\n\nNews Headline: {{ $json.title }}\nNews Body: {{ $json.text }}\n\nTask: Evaluate if this news event presents a physical, real-world operational challenge where remote drone inspection, structural surveying, or aerial monitoring would be necessary.\n\nStrict Evaluation Rules:\n1. THE KILL SWITCH: If the news is about corporate mergers, acquisitions, HR software rollouts, digital compliance, finance, retail, or general business strategy without a direct physical infrastructure threat, you must reject it. \n2. THE QUALIFIER: If the news involves physical infrastructure damage, hazardous environments, structural integrity, or remote topographical surveying (e.g., offshore rigs, mining pits, power lines), you must accept it.\n\nOutput Constraints (CRITICAL):\n- If the news triggers the Kill Switch, output ONLY the exact word: DISQUALIFIED\n- If the news is a valid Qualifier, output ONLY a highly technical, 1-sentence summary of the physical operational constraint. Do not use fluff. \n- NEVER include introductory text like \"Here is the summary\" or \"The constraint is\". Just output the raw data."
}
]
},
"builtInTools": {}
},
"credentials": {
"googlePalmApi": {
"id": "7SCOLsN3hGljUnhL",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1.2
},
{
"id": "8df4c808-6e82-462a-894b-d7b715be81d7",
"name": "FIlter Disqualified Leads",
"type": "n8n-nodes-base.filter",
"position": [
800,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2c12bc76-b047-4b8c-97bc-827c01443f4e",
"operator": {
"type": "string",
"operation": "notContains"
},
"leftValue": "={{ $json.content.parts[0].text }}",
"rightValue": "DISQUALIFIED"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "b4bcb598-1f42-48b3-bc9c-5fb318bcbca2",
"name": "Mock Apollo API",
"type": "n8n-nodes-base.code",
"position": [
1408,
0
],
"parameters": {
"jsCode": "for (let item of $input.all()) {\n // The Nuclear Option: Convert the entire incoming data payload into a single raw text string\n let rawData = JSON.stringify(item.json).toLowerCase();\n \n // Directly search the raw string to assign the correct person\n if (rawData.includes('equinor') || rawData.includes('renewables') || rawData.includes('wind')) {\n item.json.people = [\n {\n first_name: 'Elena',\n last_name: 'Rostova',\n title: 'Director of Wind Energy'\n }\n ];\n } else if (rawData.includes('anglo') || rawData.includes('mining') || rawData.includes('metals')) {\n item.json.people = [\n {\n first_name: 'Arthur',\n last_name: 'Pendelton',\n title: 'VP of Mining Operations'\n }\n ];\n } else {\n // Fallback for Shell or anything else\n item.json.people = [\n {\n first_name: 'Marcus',\n last_name: 'Vance',\n title: 'Director of Offshore Operations'\n }\n ];\n }\n}\n\nreturn $input.all();"
},
"typeVersion": 2
},
{
"id": "55dfeeda-f00f-4a55-9003-781961a63a59",
"name": "Split Out Leads",
"type": "n8n-nodes-base.splitOut",
"position": [
1616,
0
],
"parameters": {
"include": "allOtherFields",
"options": {},
"fieldToSplitOut": "people[0].first_name, people[0].last_name, people[0].title"
},
"typeVersion": 1
},
{
"id": "fccb66af-3f31-45d6-b17b-04c815260d4c",
"name": "Append row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
1824,
0
],
"parameters": {
"columns": {
"value": {
"Lead Name ": "={{ $json['people[0].first_name'] }}{{ $json['people[0].last_name'] }}",
"Case Study ": "={{ $('Case Study Category').item.json.content.parts[0].text }}",
"Lead Title ": "={{ $json['people[0].title'] }}",
"Project Title": "={{ $('Mock Data Scrape ').item.json.title }}",
"AI Qualification": "={{ $('AI Qualifier').item.json.content.parts[0].text }}"
},
"schema": [
{
"id": "Project Title",
"type": "string",
"display": true,
"required": false,
"displayName": "Project Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "AI Qualification",
"type": "string",
"display": true,
"required": false,
"displayName": "AI Qualification",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Case Study ",
"type": "string",
"display": true,
"required": false,
"displayName": "Case Study ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Lead Name ",
"type": "string",
"display": true,
"required": false,
"displayName": "Lead Name ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Lead Title ",
"type": "string",
"display": true,
"required": false,
"displayName": "Lead Title ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Linkedin URL ",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Linkedin URL ",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ACdMjbt_HCaLWYm7FpdkA4qS8Up-HHcRVYshvGqs-J0/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1ACdMjbt_HCaLWYm7FpdkA4qS8Up-HHcRVYshvGqs-J0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ACdMjbt_HCaLWYm7FpdkA4qS8Up-HHcRVYshvGqs-J0/edit?usp=drivesdk",
"cachedResultName": "Push to CRM/Database"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "8mk1YXWh9lv2LUEu",
"name": "Google Sheets OAuth2 API"
}
},
"typeVersion": 4.7
},
{
"id": "fb51f062-12d0-42d2-b201-a8822eaf1735",
"name": "Case Study Category",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
1056,
0
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/gemini-2.5-flash-lite",
"cachedResultName": "models/gemini-2.5-flash-lite"
},
"options": {},
"messages": {
"values": [
{
"content": "=Role: Match the incoming operational constraint to the most relevant FlytBase Case Study Category.\n\nCategories:\n1. Oil, Gas & Energy\n2. Renewables & Solar\n3. Mining & Metals\n4. Public Safety & Emergency Response\n\nOperational Constraint: {{ $json.text }}\n\nTask: Return ONLY the exact name of the Category (e.g., \"Renewables & Solar\" or \"Mining & Metals\"). Do not add any conversational text, formatting, or explanations."
}
]
},
"builtInTools": {}
},
"credentials": {
"googlePalmApi": {
"id": "7SCOLsN3hGljUnhL",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {},
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "c1977d3d-bed2-441c-887e-47a5dd9666c3",
"connections": {
"RSS Read": {
"main": [
[]
]
},
"AI Qualifier": {
"main": [
[
{
"node": "FIlter Disqualified Leads",
"type": "main",
"index": 0
}
]
]
},
"Mock Apollo API": {
"main": [
[
{
"node": "Split Out Leads",
"type": "main",
"index": 0
}
]
]
},
"Split Out Leads": {
"main": [
[
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Mock Data Scrape ": {
"main": [
[
{
"node": "AI Qualifier",
"type": "main",
"index": 0
}
]
]
},
"Case Study Category": {
"main": [
[
{
"node": "Mock Apollo API",
"type": "main",
"index": 0
}
]
]
},
"FIlter Disqualified Leads": {
"main": [
[
{
"node": "Case Study Category",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "Mock Data Scrape ",
"type": "main",
"index": 0
}
]
]
}
}
}