n8n Workflow Automation: Building a 67-Node Lead Qualification System
n8n (pronounced "n8-n") is an open-source workflow automation platform that lets you connect different apps and services into complex automated workflows. Unlike Zapier, n8n runs on your own infrastructure, handles branching logic, and doesn't charge per task.
This post breaks down how I built a 67-node n8n workflow that qualifies leads, makes voice calls, sends SMS messages, and books appointments — all automatically.
Why n8n Over Other Automation Platforms
| Feature | n8n | Zapier | Make | |---------|-----|--------|-----| | Self-hosted | Yes | No | No | | Complex branching | Yes | Limited | Yes | | Pricing | Fixed | Per-task | Per-operation | | Open source | Yes | No | No | | Custom code | Yes | Limited | Limited |
For AI automation systems that process hundreds of leads per day with complex branching logic, n8n is the clear choice.
Architecture Overview
The 67-node system breaks down into these major sections:
1. Webhook Layer (7 nodes)
Seven separate webhook triggers handle different lead sources:
- Website form submissions
- WhatsApp Business API messages
- Incoming phone calls (Twilio)
- Zillow/Realtor.com integrations
- Manual CSV imports
- Slack command triggers
- Scheduled re-engagement tasks
Each webhook normalizes the incoming data into a standard lead format before passing it to the qualification layer.
2. AI Qualification Layer (12 nodes)
This is where GPT-4o-mini does the heavy lifting:
- Data extraction — Pull structured data from unstructured messages
- Intent scoring — Rate lead intent from 0-100
- Budget analysis — Parse budget mentions and compare to market data
- Timeline assessment — Determine urgency (buying this month vs. next year)
- Channel preference — Decide best outreach channel
- Response drafting — Generate personalized response copy
The AI runs in under 3 seconds per lead, thanks to GPT-4o-mini's speed optimization.
3. Outreach Layer (24 nodes)
Depending on the lead score, the system routes to different outreach paths:
Hot leads (80+):
- Twilio voice call with AI agent
- Follow-up SMS with booking link
- Google Calendar appointment creation
- Slack notification to human agent
Warm leads (50-79):
- Personalized WhatsApp message
- Email nurture sequence trigger
- CRM update
Cold leads (below 50):
- Add to weekly nurture list
- CRM update with "cold" status
4. Data Layer (14 nodes)
All lead data flows to:
- Google Sheets — Primary CRM with lead tracking
- Supabase — Historical data for AI training
- Slack — Real-time notifications
- Google Calendar — Appointment management
5. Monitoring Layer (10 nodes)
Built-in monitoring tracks:
- Response time per lead
- Qualification accuracy rate
- Appointment conversion rate
- System uptime and error handling
- Daily/weekly performance reports
The GPT-4o-mini Prompt Architecture
The qualification prompt is carefully engineered:
You are a lead qualification AI for a real estate agency.
Analyze the following lead data and return a JSON response with:
- lead_score: 0-100 (intent to purchase)
- qualification: "hot" | "warm" | "cold"
- key_signals: array of intent indicators
- recommended_action: next step
- response_draft: personalized message
Lead data: {lead_data}
The prompt includes few-shot examples trained on 500+ real lead interactions to ensure consistent scoring.
Error Handling and Edge Cases
A production system needs robust error handling:
- API timeouts: Fallback to SMS if voice call fails
- Rate limiting: Queue system with exponential backoff
- Invalid data: Validation nodes catch malformed inputs
- AI hallucination: Response validation before sending
- Duplicate leads: Deduplication using email + phone matching
Performance Results
After 3 months of production operation:
- 67 nodes running with 99.7% uptime
- 1,200+ leads processed per month
- 47-second average response time
- 94% qualification accuracy
- 35+ appointments booked per week
Deploying Your Own n8n System
The fastest path to a working system:
- Map your lead flow — Document every channel and data format
- Design the workflow — Start with the happy path, add error handling
- Build incrementally — Test each layer independently
- Deploy to production — Use n8n's cloud or self-host on a VPS
- Monitor and optimize — Track metrics, refine AI prompts weekly
The system pays for itself within the first month through leads that would otherwise be lost to slow response times.
Want to build an AI automation system like this for your business?
Get in touch→