FindPrompts
n8nLead GenerationAdvanced6 steps

Lead Form Enrich, Score & Route

Captures inbound form submissions, enriches the company via an enrichment API, scores the lead with GPT against your ICP, then routes hot leads to Slack and writes everyone into HubSpot. Your SDRs only see leads worth chasing.

WebhookOpenAIHubSpotSlack

How it works

  1. 1Trigger: webhook receives a new lead form submission
  2. 2Enrich the lead's company via an HTTP enrichment API
  3. 3Score the lead 0-100 against your ICP with GPT
  4. 4Create/update the contact in HubSpot
  5. 5If the score is hot, alert the sales team in Slack

Setup

  • Point your form (Typeform, Webflow, etc.) at the webhook URL.
  • Swap the enrichment API for Clearbit, Apollo, or your provider.
  • Connect OpenAI, HubSpot and Slack credentials.
  • Tune the ICP prompt and the hot-lead score threshold.

Workflow JSON

{
  "name": "Lead Form Enrich, Score & Route",
  "nodes": [
    {
      "id": "lf01aa",
      "name": "Lead Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        200,
        300
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "new-lead",
        "responseMode": "onReceived"
      }
    },
    {
      "id": "lf02bb",
      "name": "Enrich Company",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        400,
        300
      ],
      "parameters": {
        "url": "=https://api.enrichment.example.com/company?domain={{ $json.body.email.split('@')[1] }}",
        "method": "GET"
      }
    },
    {
      "id": "lf03cc",
      "name": "Score Lead",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.4,
      "position": [
        600,
        300
      ],
      "parameters": {
        "modelId": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Score this lead 0-100 against our ICP (B2B SaaS, 50+ employees). Return JSON: { score: number, reason: string }."
            },
            {
              "role": "user",
              "content": "Lead: {{ JSON.stringify($('Lead Form Webhook').item.json.body) }}\nCompany: {{ JSON.stringify($json) }}"
            }
          ]
        },
        "jsonOutput": true
      }
    },
    {
      "id": "lf04dd",
      "name": "Upsert HubSpot Contact",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 2.1,
      "position": [
        800,
        300
      ],
      "parameters": {
        "resource": "contact",
        "operation": "upsert",
        "email": "={{ $('Lead Form Webhook').item.json.body.email }}",
        "additionalFields": {
          "leadScore": "={{ $json.message.content.score }}"
        }
      }
    },
    {
      "id": "lf05ee",
      "name": "Hot Lead?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1000,
        300
      ],
      "parameters": {
        "conditions": {
          "conditions": [
            {
              "leftValue": "={{ $('Score Lead').item.json.message.content.score }}",
              "rightValue": 70,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ]
        }
      }
    },
    {
      "id": "lf06ff",
      "name": "Alert Sales",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [
        1220,
        220
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channelId": "#hot-leads",
        "text": "Hot lead ({{ $('Score Lead').item.json.message.content.score }}): {{ $('Lead Form Webhook').item.json.body.email }}"
      }
    }
  ],
  "connections": {
    "Lead Form Webhook": {
      "main": [
        [
          {
            "node": "Enrich Company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Company": {
      "main": [
        [
          {
            "node": "Score Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score Lead": {
      "main": [
        [
          {
            "node": "Upsert HubSpot Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert HubSpot Contact": {
      "main": [
        [
          {
            "node": "Hot Lead?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hot Lead?": {
      "main": [
        [
          {
            "node": "Alert Sales",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "active": false,
  "settings": {},
  "meta": {}
}

Command Palette

Search for a command to run...