Home/ Workflows/ Small Business/ Sales & Marketing
Workflow · Small Business

Small Business Lead Capture Automation Workflow

Automate lead capture from multiple sources, qualify prospects, and nurture them through personalized email sequences to boost conversion rates

Small Business Lead Capture Automation Workflow

Why This Automation Matters

For small businesses, every lead is precious. Manual lead capture and follow-up processes often result in missed opportunities, delayed responses, and inconsistent communication. This automation workflow transforms your lead capture process by:

This workflow can increase lead conversion rates by 30-50% while reducing manual work by up to 80%.

What You Need Before Starting

Required Tools and Accounts

Prerequisites

Preparation Steps

  1. Set up lead capture forms with proper field validation
  2. Create email templates for welcome messages and nurture sequences
  3. Define lead scoring rules and qualification criteria
  4. Prepare your CRM or spreadsheet with appropriate columns
  5. Gather API keys for all integrated services

Complete Node-by-Node Build Instructions

Step 1: Set Up the Webhook Trigger

  1. Add a Webhook node as your starting point
  2. Configure the webhook settings:
    • HTTP Method: POST
    • Path: /lead-capture
    • Response Mode: Respond Immediately
  3. Copy the webhook URL for later use in your forms
  4. Test the webhook by sending a sample payload

Step 2: Validate and Parse Lead Data

  1. Add a Code node after the webhook
  2. Name it “Validate Lead Data”
  3. Insert the following JavaScript code:
const requiredFields = ['email', 'name', 'source'];
const leadData = $input.first().json;

// Validate required fields
for (const field of requiredFields) {
  if (!leadData[field]) {
    throw new Error(`Missing required field: ${field}`);
  }
}

// Clean and format data
const cleanedLead = {
  email: leadData.email.toLowerCase().trim(),
  name: leadData.name.trim(),
  company: leadData.company || '',
  phone: leadData.phone || '',
  source: leadData.source,
  timestamp: new Date().toISOString(),
  leadId: `lead_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
};

return { json: cleanedLead };

Step 3: Score and Qualify Leads

  1. Add another Code node named “Lead Scoring”
  2. Connect it to the validation node
  3. Add this scoring logic:
const lead = $input.first().json;
let score = 0;
let priority = 'low';
let category = 'general';

// Industry scoring
const highValueIndustries = ['technology', 'healthcare', 'finance'];
if (highValueIndustries.includes(lead.industry?.toLowerCase())) {
  score += 20;
}

// Company size scoring
if (lead.companySize === 'enterprise') score += 25;
else if (lead.companySize === 'medium') score += 15;
else if (lead.companySize === 'small') score += 10;

// Source scoring
if (lead.source === 'organic-search') score += 15;
else if (lead.source === 'referral') score += 20;
else if (lead.source === 'paid-ads') score += 10;

// Budget indication
if (lead.budget && parseInt(lead.budget.replace(/\D/g, '')) > 10000) {
  score += 30;
}

// Determine priority and category
if (score >= 50) {
  priority = 'high';
  category = 'sales-qualified';
} else if (score >= 30) {
  priority = 'medium';
  category = 'marketing-qualified';
}

const scoredLead = {
  ...lead,
  score,
  priority,
  category,
  scoredAt: new Date().toISOString()
};

return { json: scoredLead };

Step 4: Save Lead to Database

  1. Add a Google Sheets node (or your preferred CRM connector)
  2. Configure the connection:
    • Operation: Append
    • Document ID: Your lead tracking spreadsheet ID
    • Sheet: Lead Database
  3. Map the following fields:
    • Lead ID → Column A
    • Name → Column B
    • Email → Column C
    • Company → Column D
    • Phone → Column E
    • Source → Column F
    • Score → Column G
    • Priority → Column H
    • Category → Column I
    • Timestamp → Column J

Step 5: Send Welcome Email

  1. Add an Email Send node or your email service provider node
  2. Configure the email settings:
    • To: {{$json.email}}
    • Subject: Welcome {{$json.name}}! Thanks for your interest
    • Email Type: HTML
  3. Create a personalized email template:
<h2>Hi {{$json.name}},</h2>
<p>Thank you for your interest in our services! We're excited to help your business grow.</p>
<p><strong>What happens next?</strong></p>
<ul>
  <li>We've recorded your information and assigned you lead ID: {{$json.leadId}}</li>
  <li>You'll receive helpful resources via email over the next few days</li>
  <li>A team member will reach out within 24 hours if you're a qualified prospect</li>
</ul>
<p>In the meantime, feel free to explore our <a href="https://yourwebsite.com/resources">resource center</a>.</p>
<p>Best regards,<br>Your Business Team</p>

Step 6: Route High-Priority Leads

  1. Add an IF node to create conditional logic
  2. Set the condition: {{$json.priority}} equal high
  3. Connect the TRUE branch to immediate sales notification
  4. Connect the FALSE branch to standard nurture sequence

Step 7: Notify Sales Team (High Priority)

  1. Add a Slack or Discord node on the TRUE branch
  2. Configure the notification:
    • Channel: #sales-alerts
    • Message:
🔥 HIGH PRIORITY LEAD ALERT 🔥
Name: {{$json.name}}
Email: {{$json.email}}
Company: {{$json.company}}
Score: {{$json.score}}
Source: {{$json.source}}
Lead ID: {{$json.leadId}}

Action required: Follow up within 2 hours!

Step 8: Trigger Nurture Campaign

  1. Add a Mailchimp or HTTP Request node on the FALSE branch
  2. Configure to add the lead to appropriate email sequence:
    • Marketing Qualified Leads → “Nurture Sequence A”
    • General Leads → “Nurture Sequence B”
  3. Set up the API call to trigger the email automation

Step 9: Log Activity

  1. Add a final Google Sheets node for activity logging
  2. Configure to append to “Activity Log” sheet:
    • Timestamp
    • Lead ID
    • Action Taken
    • Next Follow-up Date
    • Assigned Team Member

Full Workflow JSON Code

{
  "name": "Small Business Lead Capture Automation",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead-capture",
        "options": {}
      },
      "name": "Lead Capture Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [240, 300],
      "webhookId": "auto-generated"
    },
    {
      "parameters": {
        "jsCode": "const requiredFields = ['email', 'name', 'source'];\nconst leadData = $input.first().json;\n\n// Validate required fields\nfor (const field of requiredFields) {\n  if (!leadData[field]) {\n    throw new Error(`Missing required field: ${field}`);\n  }\n}\n\n// Clean and format data\nconst cleanedLead = {\n  email: leadData.email.toLowerCase().trim(),\n  name: leadData.name.trim(),\n  company: leadData.company || '',\n  phone: leadData.phone || '',\n  source: leadData.source,\n  timestamp: new Date().toISOString(),\n  leadId: `lead_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n};\n\nreturn { json: cleanedLead };"
      },
      "name": "Validate Lead Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [460, 300]
    },
    {
      "parameters": {
        "jsCode": "const lead = $input.first().json;\nlet score = 0;\nlet priority = 'low';\nlet category = 'general';\n\n// Industry scoring\nconst highValueIndustries = ['technology', 'healthcare', 'finance'];\nif (highValueIndustries.includes(lead.industry?.toLowerCase())) {\n  score += 20;\n}\n\n// Company size scoring\nif (lead.companySize === 'enterprise') score += 25;\nelse if (lead.companySize === 'medium') score += 15;\nelse if (lead.companySize === 'small') score += 10;\n\n// Source scoring\nif (lead.source === 'organic-search') score += 15;\nelse if (lead.source === 'referral') score += 20;\nelse if (lead.source === 'paid-ads') score += 10;\n\n// Budget indication\nif (lead.budget && parseInt(lead.budget.replace(/\\D/g, '')) > 10000) {\n  score += 30;\n}\n\n// Determine priority and category\nif (score >= 50) {\n  priority = 'high';\n  category = 'sales-qualified';\n} else if (score >= 30) {\n  priority = 'medium';\n  category = 'marketing-qualified';\n}\n\nconst scoredLead = {\n  ...lead,\n  score,\n  priority,\n  category,\n  scoredAt: new Date().toISOString()\n};\n\nreturn { json: scoredLead };"
      },
      "name": "Lead Scoring",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": "YOUR_SPREADSHEET_ID",
        "sheetName": "Lead Database",
        "columnToMatchOn": "leadId",
        "valuesToWrite": {
          "leadId": "={{$json.leadId}}",
          "name": "={{$json.name}}",
          "email": "={{$json.email}}",
          "company": "={{$json.company}}",
          "phone": "={{$json.phone}}",
          "source": "={{$json.source}}",
          "score": "={{$json.score}}",
          "priority": "={{$json.priority}}",
          "category": "={{$json.category}}",
          "timestamp": "={{$json.timestamp}}"
        }
      },
      "name": "Save to Database",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 3,
      "position": [900, 300]
    },
    {
      "parameters": {
        "fromEmail": "noreply@yourbusiness.com",
        "toEmail": "={{$json.email}}",
        "subject": "Welcome {{$json.name}}! Thanks for your interest",
        "emailType": "html",
        "message": "<h2>Hi {{$json.name}},</h2>\n<p>Thank you for your interest in our services! We're excited to help your business grow.</p>\n<p><strong>What happens next?</strong></p>\n<ul>\n  <li>We've recorded your information and assigned you lead ID: {{$json.leadId}}</li>\n  <li>You'll receive helpful resources via email over the next few days</li>\n  <li>A team member will reach out within 24 hours if you're a qualified prospect</li>\n</ul>\n<p>In the meantime, feel free to explore our <a href=\"https://yourwebsite.com/resources\">resource center</a>.</p>\n<p>Best regards,<br>Your Business Team</p>"
      },
      "name": "Send Welcome Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [1120, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.priority}}",
              "operation": "equal",
              "value2": "high"
            }
          ]
        }
      },
      "name": "High Priority Check",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [1340, 300]
    },
    {
      "parameters": {
        "channel": "#sales-alerts",
        "text": "🔥 HIGH PRIORITY LEAD ALERT 🔥\nName: {{$json.name}}\nEmail: {{$json.email}}\nCompany: {{$json.company}}\nScore: {{$json.score}}\nSource: {{$json.source}}\nLead ID: {{$json.leadId}}\n\nAction required: Follow up within 2 hours!",
        "otherOptions": {}
      },
      "name": "Notify Sales Team",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [1560, 180]
    },
    {
      "parameters": {
        "list": "YOUR_MAILCHIMP_LIST_ID",
        "email": "={{$json.email}}",
        "mergeFields": {
          "customFieldsUi": [
            {
              "name": "FNAME",
              "value": "={{$json.name}}"
            },
            {
              "name": "COMPANY",
              "value": "={{$json.company}}"
            },
            {
              "name": "LEADSCORE",
              "value": "={{$json.score}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Add to Nurture Campaign",
      "type