Course/Chapter 7/1. Lead Capture → CRM Pipeline
    intermediate
    Chapter 7: Real-World Automation Projects

    1. Lead Capture → CRM Pipeline

    Build a full lead capture and enrichment workflow.

    25m Lesson 1 of 5

    This project builds a complete lead management pipeline: capture leads from a web form, enrich the data, score them, and sync to your CRM.

    Workflow Architecture

    1. Webhook Trigger: Receive form submissions
    2. Validation: Check required fields
    3. Enrichment: Look up company data via Clearbit/Apollo
    4. Scoring: Assign a lead score based on criteria
    5. CRM Sync: Create or update contact in HubSpot
    6. Notification: Alert sales team in Slack

    Code Examples

    Lead Scoring Logic
    javascript
    const lead = $input.first().json;
    let score = 0;
    
    // Company size scoring
    if (lead.company_size > 500) score += 30;
    else if (lead.company_size > 100) score += 20;
    else if (lead.company_size > 10) score += 10;
    
    // Email domain scoring
    const freeEmails = ["gmail.com", "yahoo.com", "hotmail.com"];
    const domain = lead.email.split("@")[1];
    if (!freeEmails.includes(domain)) score += 20;
    
    // Engagement scoring
    if (lead.downloaded_whitepaper) score += 15;
    if (lead.visited_pricing) score += 25;
    
    return [{
      json: {
        ...lead,
        lead_score: score,
        lead_tier: score >= 60 ? "hot" : score >= 30 ? "warm" : "cold"
      }
    }];

    Pro Tips

    • 💡Always validate incoming webhook data before processing — never trust external input

    Comprehension Quiz

    Answer 2 of 2 correctly to unlock lesson completion.

    1. What is the first step in a lead capture pipeline?

    2. Why should you validate incoming webhook data?

    Pass the quiz above to unlock lesson completion