Skip to main content

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

Workflow preview

Workflow preview
100%
Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets preview
Open on n8n.io

1. Workflow Overview

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

Best for

  • Lead Generation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.respondtowebhook, n8n-nodes-base.set, n8n-nodes-base.hubspot, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Avkash Kakdiya.

Original n8n.io source

1.1 Workflow description

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

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 Slack and Gmail, and logs the result to Google Sheets.

How it works

  1. Receives a POST webhook request with inbound lead details.
  2. Validates required fields (like name and email) and returns a 400 JSON response if the payload is invalid.
  3. Normalizes lead fields (name, email, company, region, source, and company size), calculates a lead score and tier, and assigns the lead to a rep based on region and tier.
  4. Searches HubSpot for an existing contact by the lead data and flags the lead as a duplicate when a match is found.
  5. If the lead is new, requests an outreach email draft from the OpenAI Chat Completions API; otherwise, posts a duplicate warning to Slack.
  6. Upserts the contact in HubSpot for hot/warm leads or logs the cold lead to HubSpot, then notifies the assigned rep in Slack and emails them the AI draft via Gmail.
  7. Appends a routing log row to Google Sheets and returns a JSON webhook response with the assigned rep, tier, and duplicate status.

Setup

  1. Configure the Webhook trigger URL (POST /inbound-lead) in your form, landing page, or source system to send the required lead fields.
  2. Add HubSpot OAuth2 credentials for searching and creating/updating contacts.
  3. Add Slack OAuth2 credentials and set the target channel/workspace used by the Slack notification and duplicate warning steps.
  4. Add Gmail OAuth2 credentials for sending the outreach draft to the assigned rep.
  5. Add an OpenAI API key via HTTP Header Auth (Bearer token) and confirm the model name in the OpenAI request.
  6. Add a Google Sheets Service Account credential, replace REPLACE_WITH_YOUR_SHEET_ID, and ensure the target sheet (e.g. Sheet1) has matching columns for the appended log fields.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Webhook — Inbound Lead

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 6 - Validate Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Is Valid?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 8 - Respond 400 — Bad Request

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 9 - Normalise Lead Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Score & Route Lead

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - HubSpot — Check Duplicate

Type / Role
n8n-nodes-base.hubspot - hubspot
Config choices
Version 2

Block 12 - Merge Duplicate Flag

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Slack — Duplicate Warning

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 14 - Is New Lead?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 15 - Attach Draft to Lead

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Hot or Warm?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 17 - HubSpot — Upsert Contact

Type / Role
n8n-nodes-base.hubspot - hubspot
Config choices
Version 2

Block 18 - HubSpot — Log Cold Lead

Type / Role
n8n-nodes-base.hubspot - hubspot
Config choices
Version 2

Block 19 - Slack — Notify Rep

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 20 - Gmail — Email Rep with Draft

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 21 - Google Sheets — Log Lead

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 22 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 23 - HTTP — Draft Outreach Email

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

3. Summary Table

Workflow Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets
Complexity advanced
Nodes 23
Categories Lead Generation, Multimodal AI
Author Avkash Kakdiya
Published 03 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16079/16079.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Route and score inbound leads with OpenAI, HubSpot, Slack, Gmail, and Google Sheets do?

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

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, Multimodal AI use case.