Skip to main content

Predict customer churn with AI analysis of HubSpot and Google Sheets data

Workflow preview

Workflow preview
100%
Predict customer churn with AI analysis of HubSpot and Google Sheets data preview
Open on n8n.io

Important notice

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

1. Workflow Overview

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 combin...

Best for

  • CRM automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.hubspot, n8n-nodes-base.splitinbatches, n8n-nodes-base.set, n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.splitout

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Predict customer churn with AI analysis of HubSpot and Google Sheets data
Workflow name
Predict customer churn with AI analysis of HubSpot and Google Sheets data

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.

What it does

This end-to-end workflow continuously monitors customer health by consolidating data from HubSpot and Google Sheets. Here’s how it works:

  • Fetch deals from HubSpot.
  • Collect context — linked support tickets and feature usage from a Google Sheet.
  • Run sentiment analysis on the tickets to generate a customer health score.
  • Evaluate risk — an AI agent reviews deal age, sentiment score, and usage trends against predefined thresholds.
  • Send alerts — if churn risk is detected, it automatically sends a clear, data-driven email to the responsible team member with next-step recommendations.

How to set it up

To get started, configure your credentials and parameters in the following nodes:

  1. Credentials:
    • HubSpot: Connect your account (HubSpot: Get All Deals).
    • LLM Model: Add credentials for your preferred provider (Config: Set LLM for Agent & Chains).
    • Google Sheets: Connect your account (Tool: Get Feature Usage from Sheets).
    • Email: Set up your SMTP credentials (Email: Send Churn Alert).
  2. Tool URLs:
    • In Tool: Calculate Sentiment Score, enter the Webhook URL from the Trigger: Receive Tickets for Scoring node within this same workflow.
    • In Tool: Get HubSpot Data, enter the Endpoint URL for your MCP HubSpot data workflow. (Note: This tool does call an external workflow).
  3. Google Sheet:
    • In Tool: Get Feature Usage from Sheets, enter the Document ID for your own Google Sheet.
  4. Email Details:
    • In Email: Send Churn Alert, change the From and To email addresses.

Requirements

  • HubSpot account with Deals API access
  • LLM provider account (e.g. OpenAI)
  • Google Sheets tracking customer feature usage
  • n8n with LangChain community nodes enabled
  • A separate n8n workflow set up to act as an MCP endpoint for fetching HubSpot data (called by Tool: Get HubSpot Data).

How to customize it

Tailor this workflow to match your business logic:

  • Scoring logic: Adjust the JavaScript in the Code: Convert Sentiment to Score node to redefine how customer scores are calculated.
  • Alert thresholds: Update the prompt in the AI Chain: Analyze for Churn Risk node to fine-tune when alerts trigger (e.g. deal age, score cutoff, or usage drop).
  • Data sources: Swap HubSpot or Google Sheets for your CRM or database of choice — like Salesforce or Airtable.

Outcome: A proactive customer health monitoring system that surfaces risks before it’s too late — keeping your team focused on prevention, not firefighting.

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 - Manual Trigger: Run Churn Analysis

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

Block 6 - HubSpot: Get All Deals

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

Block 7 - Start Loop: For Each Deal

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 8 - Set: Isolate Current Deal ID Export to Sheets

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

Block 9 - Trigger: Receive Tickets for Scoring

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

Block 10 - Code: Format Tickets for Analysis

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

Block 11 - Loop: For Each Ticket

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

Block 12 - AI: Analyze Ticket Sentiment

Type / Role
@n8n/n8n-nodes-langchain.sentimentAnalysis - sentimentAnalysis
Config choices
Version 1.1

Block 13 - Merge: Consolidate Results

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 14 - Code: Convert Sentiment to Score

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

Block 15 - Code: Sum All Ticket Scores

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

Block 16 - Respond: Return Total Score Export to Sheets

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

Block 17 - AI Agent: Gather Customer Data

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

Block 18 - Config: Set LLM for Agent & Chains

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

Block 19 - Tool: Get HubSpot Data

Type / Role
@n8n/n8n-nodes-langchain.mcpClientTool - mcpClientTool
Config choices
Version 1.1

Block 20 - Tool: Calculate Sentiment Score

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

Block 21 - Tool: Get Feature Usage from Sheets

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 22 - AI: Structure Agent's Findings Export to Sheets

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 23 - Code: Group Feature Data by Name

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

Block 24 - AI Chain: Analyze for Churn Risk

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Showing the first 24 of 27 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Predict customer churn with AI analysis of HubSpot and Google Sheets data
Complexity advanced
Nodes 27
Categories CRM, AI Summarization
Author PollupAI
Published 26 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10199/10199.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 Predict customer churn with AI analysis of HubSpot and Google Sheets data do?

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 combin...

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