Skip to main content

AI email reply based on HubSpot data + Slack approval

Workflow preview

Workflow preview
100%
AI email reply based on HubSpot data + Slack approval preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This n8n template drafts customer ready email replies using Google Gemini, enriched with HubSpot context (contact, deals, companies, tickets). Each draft is routed to Slack for one click approval b...

Best for

  • Lead Nurturing automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.gmail, n8n-nodes-base.gmailtrigger, n8n-nodes-base.filter, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.hubspot, n8n-nodes-base.code, n8n-nodes-base.httprequest

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
AI email reply based on HubSpot data + Slack approval
Workflow name
AI email reply based on HubSpot data + Slack approval

This n8n template drafts customer-ready email replies using Google Gemini, enriched with HubSpot context (contact, deals, companies, tickets). Each draft is routed to Slack for one-click approval before it’s sent from Gmail—so you move fast without losing control.

Ideal for support and sales teams that want speedy, personalized responses while keeping humans in the loop.


How it works

  • Gmail Trigger watches for new inbound emails.

  • Sender filter excludes internal domains (e.g., n8n.io) to avoid auto-replying to teammates.

  • HubSpot contact lookup finds the sender and fetches associated deals/companies/tickets via association + batch read.

  • CRM context is normalized into clean, LLM-friendly fields (no IDs or sensitive noise).

  • Gemini (Google AI Studio) generates a concise, friendly reply using:

    • Sender name, subject, and message snippet
    • Safe, relevant HubSpot context (e.g., top 1–2 deals or an open ticket)
    • Style constraints (≤ ~150 words, single CTA, optional clarifying question)
  • Slack approval posts the draft to a channel; if approved, n8n replies via Gmail in the original thread.


How to use

  1. Gmail: Connect the same account for the trigger and reply nodes.
  2. HubSpot: Connect OAuth on the search + HTTP request nodes.
  3. Gemini: Add your Google AI Studio API key to the Google Gemini Chat Model node.
  4. Slack: Connect and select the channel for draft approvals.
  5. (Optional) Filter: Adjust the Allowed Sender filter before going live.
  6. (Optional) Prompt: Edit “Draft Reply (AI Agent)” tone/length or how much CRM detail to include.
  7. Activate the workflow. New emails will produce Slack-approved replies automatically.

Requirements

  • Gmail (trigger + send)
  • HubSpot (OAuth2) for contact + associations
  • Slack for approval step
  • Google Gemini (Google AI Studio API key)

Notes & customization

  • Safety rails: The prompt avoids exposing IDs/raw JSON and caps CRM details to what’s useful.
  • Auto-send mode: Skip Slack if you want fully automated replies for specific senders/labels.
  • Richer context: Extend the batch read to pull more properties (e.g., next step, renewal date).
  • Triage: Branch on subject/labels to route billing vs. technical requests to different prompts.
  • QA queue: If the model asks a clarifying question, keep it to one—the node enforces that.

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 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 2 - Reply to a message

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

Block 3 - Watch Gmail (New Inbound)

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

Block 4 - Filter: Allowed Sender

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

Block 5 - Draft Reply (AI Agent)

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

Block 6 - Find Contact by Email

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

Block 7 - Set Record Types

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

Block 8 - List Contact Associations

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

Block 9 - Build Batch Read Requests

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

Block 10 - Batch Read Objects

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

Block 11 - Normalize CRM Context for LLM

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

Block 12 - Wait for Response - Approve Auto-Reply

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

Block 13 - If Approved?

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

Block 14 - Sticky Note

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

Block 15 - Sticky Note1

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

Block 16 - Sticky Note2

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

Block 17 - Sticky Note3

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

Block 18 - Workflow Overview

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

3. Summary Table

Workflow AI email reply based on HubSpot data + Slack approval
Complexity advanced
Nodes 18
Categories Lead Nurturing, AI Chatbot
Author Miha
Published 26 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8967/8967.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 AI email reply based on HubSpot data + Slack approval do?

This n8n template drafts customer ready email replies using Google Gemini, enriched with HubSpot context (contact, deals, companies, tickets). Each draft is routed to Slack for one click approval b...

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