Email Automation
Classify churn and send monthly SaaS reports with Notion, Sheets and Gemini
When something happens in a connected app, it handles email with Google Gemini using Gmail, Google Sheets, Notion, Slack.
What it does
## Workflow Overview: Automated Churn Classification & Reporting This workflow acts as an automated Churn Classification Engine for your SaaS metrics. It captures subscription cancellations, performs a historical check against payment failure (dunning) records in Google Sheets, and mathematically classifies the churn type based on recent billing events. By automating the categorization of involuntary versus voluntary churn and deploying an AI agent to generate monthly executive summaries, it ensures leadership has immediate visibility into solvable revenue leaks versus product-related attrition. ## How it works This workflow acts as an automated Revenue Insights System for your business. It automatically monitors for subscription cancellations, standardizes the customer data, and cross-references your database for active payment failures. If a payment failure occurred within the allowed window prior to cancellation, the system classifies the revenue loss as involuntary and logs the result. At the end of every month, a scheduled branch dynamically aggregates the classified data, feeds the metrics to an AI engine to draft a concise analytical summary, and instantly emails the formatted HTML performance report to your team. ## Setup Steps Trigger: Cancellation Event — Start the workflow when a subscription cancellation is detected. Format Cancellation Data — Standardize the incoming payload to isolate the customer ID, revenue, and date. Fetch Dunning History — Query Google Sheets for any recent, unresolved payment failure records matching the customer. Validate Dunning Window — Execute mathematical logic to verify the payment failed before cancellation. Is Involuntary Churn? — Route the workflow based on the presence of a valid payment failure sequence. Assign Churn Category — Classify the event definitively as Involuntary or Voluntary with contextual notes. Log Churn Event — Append the structured classification result into the master tracking database. Trigger: Monthly Rollup — Initiate the reporting pipeline automatically on a fixed monthly schedule. Fetch Churn Log — Retrieve the historical classification records for the previous billing cycle. Calculate Monthly Metrics — Dynamically sum the counts and revenue lost grouped by churn category. Generate AI Narrative — Feed the aggregated metrics into Gemini to draft a structured executive summary. Enforce JSON
The steps
- Trigger: Cancellation Event
- Format Cancellation Data
- Fetch Dunning History
- Validate Dunning Window
- Is Involuntary Churn?
- Assign Churn Category
- Log Churn Event
- Trigger: Monthly Rollup
- Fetch Churn Log
- Calculate Monthly Metrics
- Generate AI Narrative
- Gemini Engine
- Enforce JSON Schema
- Extract Report Data
20 steps in total.
Similar automations
Tasks & Project ManagementOrchestrate employee onboarding across HR, IAM, IT and SaaS via webhook16 stepsEmail AutomationDetect SaaS subscription leaks with Google Drive, Gmail, OpenAI, and Slack23 stepsEmail AutomationScore customer health and flag churn risk with Stripe, Zendesk, OpenAI, Slack and HubSpot24 stepsMonitoring, Ops & IncidentsFlag B2B churn-risk orders from Google Sheets with Gemini and Slack alerts22 steps