AutomationFlowsMarketing & Ads › Lead Generation and Scoring Workflow

Lead Generation and Scoring Workflow

Original n8n title: Lead Generation

Lead Generation. Uses start. Manual trigger; 8 nodes.

Manual trigger★★★★☆ complexity8 nodesStart
Marketing & Ads Trigger: Manual Nodes: 8 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Lead Generation",
  "description": "Automated lead capture and qualification workflow with scoring and routing",
  "category": "business-automation",
  "difficulty": "intermediate",
  "estimatedTime": "15 minutes",
  "prerequisites": [
    "Business automation concepts",
    "Lead scoring knowledge"
  ],
  "learningObjectives": [
    "Learn lead qualification automation",
    "Practice lead scoring algorithms",
    "Understand CRM integration patterns"
  ],
  "nodes": [
    {
      "parameters": {},
      "id": "start",
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "leadId",
            "value": "{{ 'LEAD-' + formatDate(now(), 'yyyyMMdd') + '-' + randomString(6) }}"
          },
          {
            "name": "email",
            "value": "jane.smith@techcorp.com"
          },
          {
            "name": "firstName",
            "value": "Jane"
          },
          {
            "name": "lastName",
            "value": "Smith"
          },
          {
            "name": "company",
            "value": "TechCorp Inc."
          },
          {
            "name": "jobTitle",
            "value": "VP of Engineering"
          },
          {
            "name": "phone",
            "value": "+1-555-0123"
          },
          {
            "name": "website",
            "value": "https://techcorp.com"
          },
          {
            "name": "industry",
            "value": "Technology"
          },
          {
            "name": "companySize",
            "value": "500+"
          },
          {
            "name": "budget",
            "value": "$50k+"
          },
          {
            "name": "source",
            "value": "referral"
          },
          {
            "name": "capturedAt",
            "value": "{{ formatDate(now(), 'yyyy-MM-dd HH:mm:ss') }}"
          }
        ]
      },
      "id": "extract-lead-data",
      "name": "Extract Lead Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "isValidEmail",
            "value": "{{ isEmail($json.email) }}"
          },
          {
            "name": "hasCompanyInfo",
            "value": "{{ and(isNotEmpty($json.company), isNotEmpty($json.jobTitle)) }}"
          },
          {
            "name": "hasContactInfo",
            "value": "{{ and(isNotEmpty($json.firstName), isNotEmpty($json.lastName)) }}"
          },
          {
            "name": "isComplete",
            "value": "{{ and($json.isValidEmail, $json.hasCompanyInfo, $json.hasContactInfo) }}"
          }
        ]
      },
      "id": "validate-lead",
      "name": "Validate Lead",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "emailScore",
            "value": "{{ $json.isValidEmail ? 10 : 0 }}"
          },
          {
            "name": "companyScore",
            "value": "{{ isNotEmpty($json.company) ? 15 : 0 }}"
          },
          {
            "name": "jobTitleScore",
            "value": "{{ includes(lower($json.jobTitle), 'director') ? 20 : includes(lower($json.jobTitle), 'manager') ? 15 : includes(lower($json.jobTitle), 'vp') ? 25 : includes(lower($json.jobTitle), 'ceo') ? 30 : 5 }}"
          },
          {
            "name": "companySizeScore",
            "value": "{{ $json.companySize === '500+' ? 25 : $json.companySize === '100-500' ? 20 : $json.companySize === '50-100' ? 15 : $json.companySize === '10-50' ? 10 : 5 }}"
          },
          {
            "name": "budgetScore",
            "value": "{{ $json.budget === '$50k+' ? 30 : $json.budget === '$25k-50k' ? 20 : $json.budget === '$10k-25k' ? 15 : $json.budget === '$5k-10k' ? 10 : 5 }}"
          },
          {
            "name": "sourceScore",
            "value": "{{ $json.source === 'referral' ? 20 : $json.source === 'linkedin' ? 15 : $json.source === 'google' ? 10 : $json.source === 'website' ? 5 : 0 }}"
          }
        ]
      },
      "id": "calculate-scores",
      "name": "Calculate Scores",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "totalScore",
            "value": "{{ add($json.emailScore, $json.companyScore, $json.jobTitleScore, $json.companySizeScore, $json.budgetScore, $json.sourceScore) }}"
          },
          {
            "name": "leadGrade",
            "value": "{{ if($json.totalScore >= 80, 'A', if($json.totalScore >= 60, 'B', if($json.totalScore >= 40, 'C', 'D'))) }}"
          },
          {
            "name": "leadQuality",
            "value": "{{ if($json.totalScore >= 80, 'Hot', if($json.totalScore >= 60, 'Warm', if($json.totalScore >= 40, 'Cold', 'Unqualified'))) }}"
          },
          {
            "name": "priority",
            "value": "{{ if($json.totalScore >= 80, 'High', if($json.totalScore >= 60, 'Medium', 'Low')) }}"
          }
        ]
      },
      "id": "assign-grade",
      "name": "Assign Grade",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "rules": [
          {
            "field": "$json.leadGrade",
            "operation": "equal",
            "value": "A"
          }
        ]
      },
      "id": "routing-switch",
      "name": "Routing Switch",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [
        1340,
        300
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "assignedTo",
            "value": "senior_sales_team"
          },
          {
            "name": "followUpTime",
            "value": "{{ formatDate(addDays(now(), 1), 'yyyy-MM-dd HH:mm:ss') }}"
          },
          {
            "name": "nextAction",
            "value": "immediate_call"
          },
          {
            "name": "automatedEmail",
            "value": "hot_lead_template"
          }
        ]
      },
      "id": "hot-lead-routing",
      "name": "Hot Lead Routing",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1560,
        200
      ]
    },
    {
      "parameters": {
        "assignments": [
          {
            "name": "assignedTo",
            "value": "{{ if($json.leadGrade === 'B', 'junior_sales_team', 'marketing_nurture') }}"
          },
          {
            "name": "followUpTime",
            "value": "{{ formatDate(addDays(now(), if($json.leadGrade === 'B', 3, 7)), 'yyyy-MM-dd HH:mm:ss') }}"
          },
          {
            "name": "nextAction",
            "value": "{{ if($json.leadGrade === 'B', 'email_outreach', 'nurture_campaign') }}"
          },
          {
            "name": "automatedEmail",
            "value": "{{ if($json.leadGrade === 'B', 'warm_lead_template', 'nurture_template') }}"
          }
        ]
      },
      "id": "standard-lead-routing",
      "name": "Standard Lead Routing",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1560,
        400
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Extract Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Lead Data": {
      "main": [
        [
          {
            "node": "Validate Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Lead": {
      "main": [
        [
          {
            "node": "Calculate Scores",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Scores": {
      "main": [
        [
          {
            "node": "Assign Grade",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign Grade": {
      "main": [
        [
          {
            "node": "Routing Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Routing Switch": {
      "main": [
        [
          {
            "node": "Hot Lead Routing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Standard Lead Routing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1"
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Lead Generation. Uses start. Manual trigger; 8 nodes.

Source: https://github.com/neul-labs/m9m/blob/main/examples/business-automation/lead-generation.json — original creator credit. Request a take-down →

More Marketing & Ads workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Marketing & Ads

Salesforce:Lead:create get addNote addToCampaign getAll getSummary update delete:Contact:create get addNote addToCampaign getAll getSummary update delete:CustomObject:create get getAll update delete:F

Start, Salesforce
Marketing & Ads

Emelia:Campaign:create addContact get getAll start pause:ContactList:getAll add. Uses start, emelia. Manual trigger; 9 nodes.

Start, Emelia
Marketing & Ads

This workflow is designed for eCommerce store owners and marketing teams who use WooCommerce. It helps segment customers based on their purchasing behavior using the RFM (Recency, Frequency, Monetary)

Start, WooCommerce
Marketing & Ads

AI Lead Auto-Responder. Uses gmail, httpRequest. Manual trigger; 7 nodes.

Gmail, HTTP Request
Marketing & Ads

This workflow allows you to create a campaign, add a contact, and get the campaign from Emelia.

Emelia