Update HubSpot contacts from Gmail auto-replies using Claude and Slack

Go to Workflow
0 views
Built by Kingsley Ken Kingsley Ken
Created on October 25, 2026

Description

Quick overview
This workflow runs hourly to find Gmail auto-replies and permanent bounces, uses Anthropic Claude to detect when a HubSpot contact has left or is out of office, and posts Slack approvals before updating HubSpot with lead status changes, notes, replacement contacts, or follow-up tasks.

How it works
Runs every hour and loads configuration values like lookback window, approval timeout, and the target Slack channel.
Verifies the HubSpot app token and required scopes before reading any emails.
Searches Gmail for recent auto-replies and bounce messages, deduplicates messages across runs, and filters to one relevant reply per contact.
Looks up each sender (or bounced address) in HubSpot and skips emails not tied to an existing contact or contacts already marked with the configured “left” lead status.
For auto-replies, sends the reply text to Anthropic Claude to classify it as left_company, out_of_office, or other and extract exact supporting quotes and any replacement contact details.
Builds a safe update plan and routes it: posts “left company” and permanent bounce cases to Slack for approval, creates HubSpot follow-up tasks for validated out-of-office return dates, and posts informational Slack alerts for HubSpot lookup errors.
If approved in Slack within the configured window, writes the planned updates to HubSpot (lead status change, CRM note, and optional new replacement contact) and then posts a Slack message summarizing what succeeded or failed.

Setup
Create a HubSpot private app and generate an access token with scopes crm.objects.contacts.read, crm.objects.contacts.write, crm.objects.companies.read, and crm.objects.companies.write, then add it as a HubSpot App Token credential.
Connect your Gmail account so the workflow can search messages, and ensure the Gmail query matches the mailbox/labels you want monitored.
Connect Slack with OAuth, copy the target channel ID, and update the Config node’s slackChannelId (and optionally lookBackDays, leftLeadStatus, approvalWaitHours, and out-of-office settings).
Add your Anthropic credentials and keep or replace the Claude model used for classification.
Confirm that the HubSpot lead status internal value in leftLeadStatus (for example UNQUALIFIED) matches a valid hs_lead_status value in your HubSpot portal.

Requirements
HubSpot account (the free CRM works; creating the private app needs super admin rights)
Gmail account you send outreach from
Slack workspace and the ID of the channel for approvals
Anthropic API key for Claude
Hourly runs use about 720 executions a month

Customization
In Config, set leftLeadStatus to another lead status value used in your HubSpot account.
Change lookBackDays, followUpDaysAfterReturn or approvalWaitHours.
Set postOutOfOffice to false to add follow-up tasks without a Slack message.
Swap the Claude model for any chat model.

Additional info
Nothing changes in HubSpot until you press Approve in Slack, and no answer within 24 hours means no change. Plan HubSpot Changes is plain code: it only uses quotes, addresses and dates found word for word in the reply, and it never adds a shared inbox such as sales@ as a contact. Out-of-office replies get a HubSpot follow-up task for the working day after the person is back.

This workflow was created by Kingsley Ken and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
HTTP Request
n8n-nodes-base.httpRequest
Slack
n8n-nodes-base.slack
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured