Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Score customer health and flag churn risk with Stripe, Zendesk, OpenAI, Slack and HubSpot

On a schedule, it handles email with OpenAI / ChatGPT using Gmail, Google Sheets, HubSpot, Slack.

What it does

## Customer Health Scoring + Churn Early-Warning CS teams find out about churn when the cancellation email arrives. Usage drops, support ticket spikes, and failed payments are visible weeks earlier, but nobody aggregates them. This workflow fuses Stripe billing signals, Zendesk support signals, and product usage signals into one explainable 0-100 health score per account, every morning. Critical accounts alert Slack and create a HubSpot task. Watchlist accounts go into one digest email. Everything is logged for trend tracking. ### How it works 1. Daily 08:00 scan (manual trigger for testing). Configuration holds all weights, thresholds, and IDs. Edit once. 2. The Account Mapping sheet is the heart of the system: it links each account to its Stripe customer ID, Zendesk org ID, and product account ID. Identity resolution across billing, support, and product is the step every basic template skips, and the reason real health scoring is hard. 3. Three arms score in parallel. Stripe: failed payments and open invoices drag the payment subscore down. Zendesk: AI classifies every ticket (sentiment, bug, urgency), then volume, anger rate, and open bugs set the support subscore. Usage API: active days and key-feature adoption set the usage subscore. 4. The fusion joins all three arms per account, computes the weighted score, and names the top risk drivers in plain language. Scores are compared to yesterday's snapshot for trend deltas. 5. Tiered response: score below critical threshold -> Slack alert + HubSpot task. Below watch threshold -> one digest email to the CS lead. Otherwise -> silent log. ### Setup 1. Create two Google Sheets: Mapping (columns: account_key, account_name, stripe_customer_id, zendesk_org_id, product_account_id, hubspot_company_id, csm_owner, csm_email) and HealthLog (columns: date, account_key, score, payment, support, usage, drivers, action). 2. Fill the Workflow Configuration node: weights, thresholds, sheet IDs, Slack channel, CS lead email, usage API base + key. 3. Connect Stripe, Zendesk, OpenAI, Slack, HubSpot, Gmail, and Google Sheets. 4. Activate. Yesterday's snapshot is read automatically for trend deltas. ### Honest notes - Stripe MRR is approximated from active subscriptions; exact revenue reconciliation is out of scope for v1. - Accounts missing from a source get that subscore excluded with a data_gap flag instead of a zero, so gaps n

The steps

  1. Daily Health Scan
  2. Manual Test Trigger
  3. Workflow Configuration
  4. Load Account Mapping
  5. Load Prior Scores
  6. Fetch Recent Invoices
  7. Fetch Active Subscriptions
  8. Score Payment Health
  9. Fetch Recent Tickets
  10. Classify Ticket Sentiment
  11. Score Support Health
  12. Fetch Usage Metrics
  13. Score Usage Health
  14. Combine Arm Outputs

24 steps in total.

Similar automations