Score B2B leads with OpenAI from webhook or form submissions
Ready for 3.0What this workflow does
This workflow has 12 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). It uses only n8n's built-in nodes. It also calls api.openai.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Config (Edit Fields (Set)): sets 1 field: SCORE_THRESHOLD
- Route by Source (If): checks a condition and branches into true / false
- Normalize Lead Data (Edit Fields (Set)): sets 5 fields: name, email, company…
- Sample Data (Edit Fields (Set)): sets 5 fields: name, email, company…
- AI Score Lead (HTTP Request): calls api.openai.com (POST)
- Parse Score (Code): runs custom JavaScript code
- Is Hot Lead? (If): checks a condition and branches into true / false
- Hot Lead (Edit Fields (Set)): sets 2 fields: status, action
- Nurture Lead (Edit Fields (Set)): sets 2 fields: status, action
- Merge: merges the data from its input branches
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Manual Trigger
n8n-nodes-base.manualTrigger - Webhook
n8n-nodes-base.webhook - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge
From the author
How it works • Receives lead data (name, email, company, website) from a webhook or manual trigger • Normalizes the payload and sends it to OpenAI for scoring (1–10) • Routes leads to Hot (≥7, immediate follow-up) or Nurture (add to sequence) • Output…