Skip to main content

Score and route inbound web leads with OpenAI, Gmail and Google Sheets

Workflow preview

Workflow preview
100%
Score and route inbound web leads with OpenAI, Gmail and Google Sheets preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow receives web form submissions via webhook, uses OpenAI to score and classify each lead, then emails hot leads through Gmail and logs them to separate Google Sheets tabs...

Best for

  • Lead Generation automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.gmail, n8n-nodes-base.googlesheets

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Score and route inbound web leads with OpenAI, Gmail and Google Sheets
Workflow name
Score and route inbound web leads with OpenAI, Gmail and Google Sheets

Quick overview

This workflow receives web form submissions via webhook, uses OpenAI to score and classify each lead, then emails hot leads through Gmail and logs them to separate Google Sheets tabs for hot versus cold review.

How it works

  1. Receives a POST webhook request containing lead details (name, email, company, role, message).
  2. Normalizes the incoming fields and adds a timestamp.
  3. Sends the lead details to OpenAI Chat Completions to return a JSON score (1–10), intent label, and one-sentence rationale.
  4. Parses and validates the AI JSON output and merges it back into the lead record.
  5. If the score is 7 or higher, sends a Gmail alert and appends the lead to the “Hot Leads” tab in Google Sheets.
  6. If the score is below 7, appends the lead to the “Cold Review” tab in Google Sheets.
  7. Responds to the webhook caller with a JSON payload including ok, score, and intent.

Setup

  1. Add an OpenAI API key (used via HTTP Header Auth) and ensure the Authorization header is set for requests to https://api.openai.com/v1/chat/completions.
  2. Connect a Gmail OAuth2 credential and set the recipient email (update the workflow variable alertInbox or replace the default [email protected]).
  3. Create a Google Sheet with two tabs named exactly “Hot Leads” and “Cold Review”, add the expected header columns, and replace REPLACE_WITH_YOUR_SHEET_ID in both Google Sheets nodes.
  4. Activate the workflow, copy the production webhook URL for the lead-qualifier endpoint, and configure your form tool to POST submissions to it as JSON.

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 - Sticky Note4

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

Block 6 - When Lead Received

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

Block 7 - Set Lead Fields

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

Block 8 - Post to AI Scoring API

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

Block 9 - Parse AI Scoring Response

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

Block 10 - Check for Hot Lead

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

Block 11 - Send Hot Lead Email

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

Block 12 - Append to Hot Leads Sheet

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

Block 13 - Append to Cold Leads Sheet

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

Block 14 - Send Form Response

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

3. Summary Table

Workflow Score and route inbound web leads with OpenAI, Gmail and Google Sheets
Complexity intermediate
Nodes 14
Categories Lead Generation, AI Summarization
Author Milos Vranes
Published 26 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15970/15970.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 Score and route inbound web leads with OpenAI, Gmail and Google Sheets do?

Quick overview This workflow receives web form submissions via webhook, uses OpenAI to score and classify each lead, then emails hot leads through Gmail and logs them to separate Google Sheets tabs...

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, AI Summarization use case.