Email Automation
Detect at-risk gym clients with Supabase, Gemini, Slack, Gmail, and Sheets
On a schedule, it handles email with Google Gemini using Gmail, Google Sheets, Slack, Supabase.
What it does
## How workflow works This workflow automatically detects gym clients who may be disengaging based on missed checkins and missing weekly form submissions. It begins with a schedule trigger, then loads active clients, recent checkins, and recent weekly form activity from Supabase. After merging the datasets, a Code node calculates risk score, inactivity days, missed activity counts, and escalation logic for each client. Only high priority clients move forward, and a cooldown check prevents duplicate alerts within a defined period. The workflow then prepares context for Gemini, generates a supportive re engagement draft, and parses the AI output into structured subject and message fields. Finally, it sends alerts to Slack and Gmail, logs the risk event in Supabase and Google Sheets, and updates client status records in both systems for future workflow runs. ## Setup Steps 1. Configure the schedule trigger to run daily at your preferred monitoring time in India timezone. 2. Connect Supabase credentials and confirm the clients, checkins, weekly_forms, and risk_events tables are available. 3. Connect Google Sheets credentials and map the Clients_Master and Risk_Alert_Log sheets correctly. 4. Connect Gemini credentials and test the AI node to confirm it returns valid JSON with subject and body. 5. Connect Slack and Gmail credentials and verify both notification nodes send test messages successfully. 6. Rename nodes using the final naming list and place sticky notes above each section with the provided section titles and descriptions. 7. Run the workflow with sample client data, confirm the logging and status update steps work correctly, then publish the final validated version.
The steps
- Daily Risk Scan Trigger
- Load Active Clients from Supabase
- Load Checkins from Supabase
- Load Weekly Forms from Supabase
- Merge Client Activity Datasets
- Check Duplicate Alert Window
- Send Coach Slack Alert
- Send Client Gmail Message
- Append Risk Log to Supabase
- Append Risk Log to Google Sheets
- Update Client Alert State in Supabase
- Calculate Client Risk Metrics
- High Risk Clients
- Prepare Alert and AI Input Payload
17 steps in total.
Similar automations
CRM & Sales PipelineSend WhatsApp win-back offers to at-risk gym members with OpenAI and ClickUp30 stepsAI Agents & AssistantsRescue at-risk gym members using Google Sheets, Gemini, and Twilio SMS15 stepsLead Generation & EnrichmentNurture Gym Leads from Facebook Ads with WhatsApp Follow-Ups26 stepsEmail AutomationDetect dividend yield traps with Google Sheets, Supabase, OpenAI, Slack, and Gmail23 steps