Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets
Ready for 3.0What this workflow does
This workflow has 19 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects HubSpot, Slack, Gmail and Google Sheets. It also calls api.openai.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Validate Payload (Code): runs custom JavaScript code
- Is Valid? (If): checks a condition and branches into true / false
- Normalise Lead Data (Edit Fields (Set)): sets 7 fields: firstName, lastName, email…
- Respond 400 — Bad Request (Respond to Webhook): sends the response back to the webhook caller
- Score & Route Lead (Code): runs custom JavaScript code
- HubSpot: search
- Merge Duplicate Flag (Code): runs custom JavaScript code
- Is New Lead? (If): checks a condition and branches into true / false
- HTTP — Draft Outreach Email (HTTP Request): calls api.openai.com (POST)
- Slack: work with chat
…plus 8 more steps. See the full node list below.
Services it uses
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 (10)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Edit Fields (Set)
n8n-nodes-base.set - HubSpot
n8n-nodes-base.hubspot - Slack
n8n-nodes-base.slack - Gmail
n8n-nodes-base.gmail - Google Sheets
n8n-nodes-base.googleSheets - HTTP Request
n8n-nodes-base.httpRequest
From the author
Quick overview This workflow receives inbound leads via webhook, validates and normalizes the data, scores and routes the lead to a sales rep, checks for duplicates and upserts the contact in HubSpot, drafts an outreach email with OpenAI, notifies the rep via…