Predict customer churn with AI analysis of HubSpot and Google Sheets data
Ready for 3.0What this workflow does
This AI workflow has 23 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects HubSpot, OpenAI Chat Model, MCP Client and HTTP Request and 1 more.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Code: runs custom JavaScript code
- HubSpot: get many (deal)
- Loop: For Each Ticket (Split Out): splits a list into separate items
- Start Loop: For Each Deal (Loop Over Items (Split in Batches)): loops over the items in batches
- AI: Analyze Ticket Sentiment (Sentiment Analysis): scores sentiment with AI, with model: Config: Set LLM for Agent & Chains
- Set: Isolate Current Deal ID Export to Sheets (Edit Fields (Set)): sets 1 field: dealId
- Merge: merges the data from its input branches
- AI Agent: runs an AI agent, with model: Config: Set LLM for Agent & Chains; 3 tools (Tool: Get HubSpot Data, Tool: Calculate Sentiment Score, Tool: Get Feature Usage from Sheets); output parser: AI: Structure Agent's Findings Export to Sheets
- Code: runs custom JavaScript code
- Code: runs custom JavaScript code
…plus 5 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (19)
- Manual Trigger
n8n-nodes-base.manualTrigger - HubSpot
n8n-nodes-base.hubspot - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Edit Fields (Set)
n8n-nodes-base.set - Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - Split Out
n8n-nodes-base.splitOut - Sentiment Analysis
@n8n/n8n-nodes-langchain.sentimentAnalysis - Merge
n8n-nodes-base.merge - Respond to Webhook
n8n-nodes-base.respondToWebhook - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - MCP Client Tool
@n8n/n8n-nodes-langchain.mcpClientTool - Http Request Tool
n8n-nodes-base.httpRequestTool - Google Sheets Tool
n8n-nodes-base.googleSheetsTool - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Markdown
n8n-nodes-base.markdown - Send Email
n8n-nodes-base.emailSend
From the author
Who it’s for Built for Customer Success and Account Management teams focused on proactive retention. This workflow helps you automatically identify at-risk customers – before they churn – by combining CRM, usage, and sentiment data into one actionable alert.…