Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Email Automation

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

  1. Daily Risk Scan Trigger
  2. Load Active Clients from Supabase
  3. Load Checkins from Supabase
  4. Load Weekly Forms from Supabase
  5. Merge Client Activity Datasets
  6. Check Duplicate Alert Window
  7. Send Coach Slack Alert
  8. Send Client Gmail Message
  9. Append Risk Log to Supabase
  10. Append Risk Log to Google Sheets
  11. Update Client Alert State in Supabase
  12. Calculate Client Risk Metrics
  13. High Risk Clients
  14. Prepare Alert and AI Input Payload

17 steps in total.

Similar automations