Score and route website leads with OpenAI and HubSpot
Ready for 3.0What this workflow does
This workflow has 12 nodes and runs when an HTTP POST request hits its webhook URL. It uses only n8n's built-in nodes. It also calls api.hubapi.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Config (Edit Fields (Set)): sets 5 fields: ai_model, openai_base_url, owner_enterprise…
- Check the lead (Code): runs custom JavaScript code
- Already in HubSpot? (HTTP Request): calls api.hubapi.com (POST)
- AI: read the message (HTTP Request): calls an HTTP API (POST)
- Score and route (Code): runs custom JavaScript code
- Rejected? (If): checks a condition and branches into true / false
- Reply: rejected (Respond to Webhook): sends the response back to the webhook caller
- Create or update contact (HTTP Request): calls api.hubapi.com (POST)
- Sales lead (A or B)? (If): checks a condition and branches into true / false
- Task for the owner (HTTP Request): calls api.hubapi.com (POST)
…plus 1 more step. See the full node list below.
HTTP calls to: api.hubapi.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 (6)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow receives website form leads via a webhook, uses OpenAI to classify intent and urgency, scores and routes each lead with custom rules, and then creates or updates the contact in HubSpot while optionally creating a follow-up task…