See llms.txt for all machine-readable content.

Back to Templates

Rescue expiring SaaS trials with Stripe, Google Sheets, Gmail and OpenAI

Quick overview

This workflow runs daily to find Stripe subscriptions whose trials end soon, looks up each user’s recent usage in Google Sheets, drafts a personalized follow-up with OpenAI, and uses Gmail to request human approval before sending, then logs outcomes to Google Sheets and escalates based on Stripe status.

How it works

  1. Runs every day at 8:00 AM on a schedule.
  2. Fetches trialing subscriptions from the Stripe API and filters to those ending within the configured trial window.
  3. Reads the Usage tab from Google Sheets, matches usage by email, and classifies each trial user as high-usage or low-usage based on login and key-action thresholds.
  4. Uses OpenAI to draft a short follow-up email tailored to the user’s usage class and trial end date.
  5. Sends the draft to the owner via Gmail for Approve/Reject, and only sends the email to the customer if the owner approves.
  6. Appends the outcome (sent or rejected) to the Outcomes tab in Google Sheets.
  7. After the configured wait period, rechecks the subscription in Stripe and either logs converted or emails the owner an escalation and logs escalated.

Setup

  1. Add an HTTP Header Auth credential for Stripe (Bearer token) and ensure the workflow can call Stripe’s /v1/subscriptions list and retrieve endpoints.
  2. Add Google Sheets OAuth2 credentials, create a spreadsheet with Usage and Outcomes tabs, and set the spreadsheet ID and tab names in the CONFIG values.
  3. Add Gmail OAuth2 credentials and set owner_email in the CONFIG values for approval requests and escalation notifications.
  4. Add an OpenAI API credential and set the ai_model in the CONFIG values.
  5. Populate and maintain the Usage tab with email, logins_last_7d, and key_actions_last_7d so the workflow can classify users correctly.