Templates / Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets

Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets

Ready for 3.0

by Avkash Kakdiya ✓ · 79 views · created 2026-06-03 · Lead Generation, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What 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.

  1. Validate Payload (Code): runs custom JavaScript code
  2. Is Valid? (If): checks a condition and branches into true / false
  3. Normalise Lead Data (Edit Fields (Set)): sets 7 fields: firstName, lastName, email…
  4. Respond 400 — Bad Request (Respond to Webhook): sends the response back to the webhook caller
  5. Score & Route Lead (Code): runs custom JavaScript code
  6. HubSpot: search
  7. Merge Duplicate Flag (Code): runs custom JavaScript code
  8. Is New Lead? (If): checks a condition and branches into true / false
  9. HTTP — Draft Outreach Email (HTTP Request): calls api.openai.com (POST)
  10. Slack: work with chat

…plus 8 more steps. See the full node list below.

Services it uses

HubSpotSlackGmailGoogle Sheets

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)

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…

Excerpt from Avkash Kakdiya's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.