Skip to main content

Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets

Workflow preview

Workflow preview
100%
Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

How it works This workflow automates the handling of new lead responses received in Gmail. It captures emails with a specific label, analyzes the message using AI to determine sentiment, intent, ur...

Best for

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

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.hubspot, n8n-nodes-base.slack, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if

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
Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets
Workflow name
Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets

How it works

This workflow automates the handling of new lead responses received in Gmail. It captures emails with a specific label, analyzes the message using AI to determine sentiment, intent, urgency, next action, and priority, and then decides whether follow-up is needed. If required, it creates tasks in HubSpot, notifies the sales team via Slack, and logs all details into Google Sheets for tracking.

Step-by-step

Trigger on New Lead Email

  • Workflow starts whenever a new email with a defined Gmail label arrives.

  • Captures the sender’s email, subject, message snippet, and timestamp.

Normalize Email Data

  • Standardizes Gmail fields into structured values:

    • leadEmail (sender’s address)

    • subject (email subject)

    • message (email content snippet)

    • source (Gmail)

    • receivedAt (timestamp)

AI-Powered Lead Analysis

  • Uses OpenAI to analyze the lead’s message.

  • Extracts:

    • Sentiment (Positive / Neutral / Negative)

    • Intent (Interested, Not Interested, Needs Info, Ready to Buy, Objection)

    • Urgency (High / Medium / Low)

    • Next Action (Call, Email, Demo, Quote, No Action)

    • Summary (1–2 sentence description)

    • Priority (Hot / Warm / Cold)

  • Parsed results are merged with the original email data.

  • Flags are added:

    • needsFollowUp (true/false)

    • isHighPriority (true/false)

Decision: Needs Follow-Up?

  • If AI suggests a follow-up action, the workflow continues.

  • Otherwise, the process stops here.

Create HubSpot Task

  • Automatically creates a HubSpot CRM task for the sales team.

  • Task includes email subject, body, and lead details.

Notify Sales Team on Slack

  • Sends a formatted message to Slack with key lead insights:

    • Summary

    • Lead email

    • Priority

    • Urgency

    • Date of analysis

Log Lead Data to Google Sheets

  • Appends structured data to Google Sheets for record-keeping.

  • Stores all fields: Email, Date, Subject, Message, Sentiment, Intent, Urgency, Next Action, Summary, and Priority.

Why use this?

  • Automates lead triage directly from Gmail.

  • Saves time by using AI-powered analysis instead of manual review.

  • Ensures no potential lead is missed by logging into Google Sheets.

  • Provides instant sales team alerts on high-priority leads.

  • Integrates seamlessly with HubSpot CRM for structured follow-up.

  • Keeps your sales pipeline efficient, organized, and proactive.

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 - 📧 Gmail: New Lead Response

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

Block 2 - 🔧 Normalize Gmail Data

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

Block 3 - 📋 Parse AI Analysis Results

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

Block 4 - 📝 HubSpot: Create Follow-up Task

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

Block 5 - 💬 Slack: Notify Sales Team

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

Block 6 - 📊 Log to Google Sheets

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

Block 7 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 8 - 🔀 Check if Data Exists

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

Block 9 - 🔍 Needs Follow-Up?

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

Block 10 - 🧠 Analyze Lead Response (AI)

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note2

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

Block 14 - Sticky Note3

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

3. Summary Table

Workflow Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets
Complexity intermediate
Nodes 14
Categories AI Summarization, Multimodal AI
Author Avkash Kakdiya
Published 21 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7680/7680.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 Automate Gmail lead follow-up with OpenAI GPT-4O, HubSpot, Slack & Google Sheets do?

How it works This workflow automates the handling of new lead responses received in Gmail. It captures emails with a specific label, analyzes the message using AI to determine sentiment, intent, ur...

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