The Problem We Were Solving
The average Nigerian B2B services firm loses qualified leads in two places. First, the qualification gap — a sales rep manually reading every inquiry and deciding who is worth pursuing. Second, the follow-up gap — 78% of leads never receive a second contact. Most CRM tools address neither. They are record-keeping systems, not action systems.
LeadPilot AI was built to close both gaps simultaneously. When a lead submits an enquiry form, the system immediately reads their message, classifies them using AI, sends a context-aware personalised email within seconds, fires an internal alert if they are a high-priority prospect, and initiates a follow-up sequence that runs automatically for the next 10 days — all before a human has seen the inquiry.
LeadPilot was designed with one non-negotiable requirement: it must respond to a lead within 60 seconds of form submission, 24 hours a day, without human involvement. Research consistently shows that responding within 5 minutes increases conversion by 9×. LeadPilot targets under 60 seconds.
The Full Architecture — How It Actually Works
LeadPilot is a single n8n workflow containing 16 nodes. The entire pipeline runs from webhook receipt to email delivery in under 45 seconds. Here is the complete flow:
A POST request arrives from your lead intake form. The webhook node receives the raw form data — name, email, company, challenge, budget, and need description.
Code node. Extracts all lead fields from the raw webhook payload, constructs a structured Gemini API request body, and passes clean variables downstream. All field parsing and data normalisation happens here.
Primary AI engine. Sends the prompt to Gemini 2.5 Flash via direct HTTP POST to the Google Generative Language API. Gemini reads the lead's challenge description, budget signal, and urgency language.
Failover gate. If Gemini returns a valid response — routes to Parse AI Result. If Gemini fails, returns an error, or times out — automatically routes to GPT-4o-mini as fallback. The system never fails silently.
Backup AI engine. GPT-4o-mini receives the same prompt if Gemini fails. Runs via the n8n OpenAI node. Both engines return identical JSON output formats — the rest of the pipeline does not need to know which AI was used.
Normalisation code node. Handles both Gemini and GPT response formats. Strips markdown code fences, extracts the JSON object, removes control characters, and falls back to a safe WARM default if parsing fails. Outputs a clean, consistent object to all downstream nodes.
Switch node. Routes the lead into one of three parallel paths — HOT, WARM, or COLD — based on the AI score. Each path has a completely different email, timing, and follow-up sequence.
The Dual AI Engine — Gemini + GPT-4o-mini
The most distinctive architectural decision in LeadPilot is the dual AI engine. Most automation workflows use a single AI provider and fail silently when it goes down. LeadPilot uses Gemini 2.5 Flash as the primary engine — fast, cost-effective, and capable — with GPT-4o-mini as an automatic fallback.
The failover logic is in the "Gemini OK?" IF node. It checks whether the Gemini response contains an error field. If the error field is empty, the response is valid and flows to the parser. If Gemini returns any error — rate limit, timeout, API failure — the flow immediately routes to the GPT-4o-mini node using identical prompt logic. The client never experiences a failure. Both engines output the same JSON structure, so the downstream parser handles both transparently.
Gemini 2.5 Flash was chosen as the primary engine for three reasons: speed (sub-second latency on most requests), cost (significantly cheaper than GPT-4o at high volume), and reliability at African API access speeds. GPT-4o-mini was chosen as fallback because it handles malformed prompt inputs more gracefully when edge-case lead data arrives.
The AI Scoring Prompt — What the AI Actually Does
The AI receives a structured prompt for every lead. It returns a JSON object with six fields — score, reason, urgency, sentiment, a custom opening line, and a recommended action. Here is the exact prompt structure used in production:
// LeadPilot AI Scoring Prompt (inside Build Prompt node) System Role: You are a lead qualification AI. Classify the lead as HOT, WARM, or COLD and detect sentiment. HOT = clear pain + budget signal + urgency in language WARM = interested but vague budget or low urgency COLD = no urgency, no budget, just browsing Sentiment: frustrated | excited | uncertain | urgent | neutral Respond ONLY with valid JSON. No other text. No markdown. Max 15 words per field value. { "score": "HOT", "reason": "one sentence explaining the score", "urgency": "high", "sentiment": "frustrated", "opening_line": "custom email opener matching their tone", "recommended_action": "what to do next" } User Message (dynamically built per lead): Name: {leadName} Company: {leadCompany} Challenge: {leadChallenge} Budget: {leadBudget} Need: {leadNeed}
The opening_line field is the most powerful output. It generates a contextually aware, tone-matched email opener specific to each lead. A frustrated lead gets a direct, empathetic opener. An excited lead gets an energetic one. This single field is what makes LeadPilot emails feel human — because the opening line is never templated, it is always AI-generated from the lead's own words.
The Three Routing Paths — HOT, WARM, COLD
After scoring, every lead is routed into one of three completely separate sequences. The routing is handled by a Switch node that evaluates the score field and opens the corresponding output path.
The HOT Lead Path — Speed is the Product
When a lead scores HOT, two things happen simultaneously. First, a personalised email is sent using the AI-generated opening line and their specific challenge details. The email references what they said, acknowledges their situation, and offers a direct booking link for a 30-minute discovery call. Second, a Slack alert fires to your team channel with full lead details, colour-coded red, flagged for response within 1 hour.
The Slack notification contains the lead's name, company, challenge description, budget, sentiment classification, tone note, the AI engine used, and the email that was sent. Your team sees everything in one message and can act immediately.
// HOT lead email — sent within 45 seconds of form submission Subject: {{ leadName }}, let's talk — I think we can help Body: Hi {{ leadName }}, {{ opening_line }} ← AI-generated, tone-matched to this specific lead I looked over what you shared — {{ leadChallenge }} — and this is exactly the kind of problem LeadPilot AI was built to solve. I'd love to show you what's possible in a quick 30-minute call. No pitch, just a real conversation about your business. Book a time here: https://calendly.com/YOUR_LINK Talk soon, YOUR_NAME
The WARM & COLD Sequences — Automated Follow-Up
WARM and COLD leads both receive multi-touch follow-up sequences that run entirely without human involvement. The sequences use n8n's Wait nodes — pausing the workflow for a defined number of days before sending the next email. No cron jobs. No external schedulers. The workflow simply resumes after the wait period expires.
WARM Lead Sequence — 3 Emails Over 7 Days
COLD Lead Sequence — 3 Emails Over 7 Days
Every sequence ends with the relationship intact. COLD leads are the most likely to convert weeks later — the person was not ready on day 1, not that they were the wrong person. A sequence that ends rudely or with silence burns a future conversion. LeadPilot's sequences are designed to leave every lead feeling respected, regardless of score.
The JSON Parser — The Most Important Node
The Parse AI Result code node is where most AI automation systems fail. Language models do not always return perfectly formatted JSON — they add markdown fences, trailing commas, newlines inside strings, or truncate mid-object when responses are long. LeadPilot's parser handles every known failure mode.
// Parse AI Result — error handling logic (simplified) 1. Check if response is from Gemini (candidates array) or GPT (choices array) 2. Extract the raw text content from whichever format is present 3. Strip markdown code fences: ```json and ``` 4. Find the first { and last } — extract only the JSON object 5. Remove newlines, carriage returns, and control characters 6. Attempt JSON.parse() 7. If parse fails: append closing "}" and retry 8. If retry fails: return safe WARM default object 9. Always merge with lead data from Build Prompt node 10. Tag output with ai_used field: "gemini-2.5-flash" or "gpt-4o-mini"
The safe default — a WARM classification with a neutral opening line — ensures that even a complete AI failure results in a professional, appropriate email being sent to the lead. The system never silently drops an inquiry. Every submission gets a response.
The Stack — What You Need to Run It
Deployment Process — One Afternoon
A full LeadPilot deployment for a client with an active lead intake form takes between 2 and 4 hours. The process has six steps:
- Import the n8n workflow JSON — open n8n, click Import, upload the LeadPilot JSON file. The entire 16-node workflow appears ready to configure. — 5 minutes
- Connect your credentials — add your Gemini API key, OpenAI API key (for fallback), SMTP email credentials, and Slack webhook URL to n8n's credential store. — 20 minutes
- Customise the email copy — edit the email body in the Send Email nodes to match your brand voice. Replace YOUR_NAME and YOUR_GMAIL_ADDRESS placeholders throughout. — 30 minutes
- Connect your intake form webhook — copy the LeadPilot webhook URL from n8n and paste it into your form tool's webhook settings. — 10 minutes
- Test with a real submission — submit a test lead through your form. Watch the workflow execute in n8n. Confirm the email arrives and the Slack alert fires. — 15 minutes
- Activate — toggle the workflow to Active in n8n. From this point, every lead submission triggers the full pipeline automatically. — 1 minute
Results from the First Production Deployment
The first LeadPilot deployment was for a Lagos-based professional services firm. Their team was spending 22 hours per week on manual lead qualification and follow-up. After a single afternoon deployment:
- Every new inquiry received a personalised response in under 60 seconds
- HOT leads received an internal Slack alert — the team closed their first HOT lead the same day it was scored, within 4 hours of submission
- The WARM sequence converted two leads that had previously gone cold after receiving no follow-up
- Time spent on manual lead qualification dropped from 22 hours per week to under 4 hours
- Within 30 days, qualified lead volume increased 3× — not because more leads arrived, but because none were being lost to slow response or absent follow-up
The Slack HOT Alert node requires a valid incoming webhook URL from your Slack workspace. If you do not use Slack, replace this node with an email notification node pointing to your own address. The setup guide included in the LeadPilot package covers both configurations step by step.
What Is in the LeadPilot Package
When you purchase LeadPilot AI from the AnchorNova Store, you receive the complete production system:
- LeadPilot-AI-P1-Core-v1.json — the complete n8n workflow, all 16 nodes, ready to import. Scoring engine, dual AI failover, HOT/WARM/COLD routing, 7-email sequences, Slack alert — all included.
- Email copy templates — all 7 email drafts for WARM and COLD sequences, plus the HOT immediate response template. Fully editable.
- Credentials setup guide — step-by-step instructions for connecting Gemini, OpenAI, SMTP, and Slack in n8n. With screenshots.
- Form integration guide — how to connect Tally, Typeform, JotForm, or a custom HTML form to the LeadPilot webhook.
- Customisation guide — how to adjust the scoring criteria, email copy, follow-up timing, and routing thresholds for your specific business.
- Email support — direct support for setup questions from the AnchorNova engineering team.
The system requires no coding. No API building. No infrastructure beyond an n8n instance — which runs for under €5 per month on a basic VPS or free on n8n Cloud at low volume. The only ongoing costs are AI API usage — typically under $8 per month for a small business processing 100–200 leads monthly.