ooligo
n8n-flow

Composite customer health score in n8n

Difficulty
advanced
Setup time
120min
For
revops · csm
RevOps

Stack

An n8n flow that computes a composite customer health score combining product usage from Gainsight, CRM activity from HubSpot, and conversation sentiment from Gong. Writes the score back to Gainsight nightly, with three sub-scores and a one-line “why this changed” note. Replaces the static, gameable health score most CS teams rely on.

What you’ll need

  • n8n self-hosted or Cloud
  • Gainsight with PX or NXT for usage data
  • HubSpot for support and CSM activity
  • Gong for conversation transcripts
  • Claude API key for sentiment scoring
  • Definitions of high/medium/low for each sub-score

Setup

  1. Define the model. Decide your sub-score weights — for example, 50% product usage, 30% CSM activity, 20% conversation sentiment. Document this in health-model.md so the rationale is auditable.
  2. Import the flow. Pull health-score.n8n.json. The flow has four parallel branches feeding a final aggregation node.
  3. Wire data sources. Gainsight branch pulls daily usage deltas. HubSpot branch pulls case volume and CSM-touch recency. Gong branch pulls call transcripts from the last 30 days and runs Claude sentiment classification per call.
  4. Aggregate and write back. The aggregation node computes the composite, generates a one-line “why” using Claude, and writes the score, sub-scores, and reason to a Gainsight custom field. Run nightly at 2am.
  5. Validate against churn. Backtest the model against the last 12 months of churn. If high-health accounts churned, your model is wrong.

How it works

Each branch normalizes its sub-score to a 0-100 scale. Usage uses a rolling 28-day window comparing current activity to the account’s own baseline, not absolute thresholds — this catches drops that absolute thresholds miss. Activity is recency plus frequency of CSM-customer touches. Sentiment runs Claude on each call and produces a rolling sentiment average, weighted by recency.

The aggregation is a weighted sum, but the output isn’t just a number. Claude generates a one-sentence explanation: “Health dropped from 78 to 64 because product usage is down 35% week over week despite three CSM touches.” That sentence is what makes the score actionable for CSMs.

The flow is idempotent. Re-runs produce the same output for the same inputs.

Watch-outs

  • Garbage in, garbage out. If your usage events aren’t tagged correctly in Gainsight, no model fixes it. Audit data quality first.
  • Backtest before trust. Run the model retroactively for a quarter and check whether it predicted the churn you saw. If it didn’t, re-weight.
  • Account-level vs. user-level usage. Some products have one power user and 99 dormant users; that account is healthy or unhealthy depending on context. Build segment-specific weights if needed.

Stack

  • n8n — orchestration and aggregation
  • Gainsight — usage data and destination for the score
  • HubSpot — support and activity signal
  • Gong — conversation transcripts for sentiment
  • Claude — sentiment classification and reason generation