Skip to content
NEWMarketplace and your team: 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

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

  1. Trigger: Cancellation Event
  2. Format Cancellation Data
  3. Fetch Dunning History
  4. Validate Dunning Window
  5. Is Involuntary Churn?
  6. Assign Churn Category
  7. Log Churn Event
  8. Trigger: Monthly Rollup
  9. Fetch Churn Log
  10. Calculate Monthly Metrics
  11. Generate AI Narrative
  12. Gemini Engine
  13. Enforce JSON Schema
  14. Extract Report Data

20 steps in total.

Similar automations