See llms.txt for all machine-readable content.
This workflow runs on a daily schedule to detect at-risk gym clients using Supabase activity data, drafts a re-engagement email with Google Gemini, notifies coaches in Slack, emails clients via Gmail, and logs and syncs alert state to Supabase and Google Sheets.
clients, checkins, weekly_forms, and risk_events tables and required columns (including status, expected check-ins/forms, coach/contact fields, and last alert timestamps) exist.models/gemini-2.5-flash.Clients_Master and Risk_Alert_Log to match your document.This workflow can be extended with several useful enhancements:
This workflow supports several practical use cases, and there can be many more depending on the business process around it:
| Issue | Possible Cause | Solution |
|---|---|---|
| No clients move past the trigger | Supabase credentials are invalid or the clients table has no active records | Check the Supabase connection and confirm active rows exist in the clients table. |
| Merge output looks incomplete | One of the three source nodes is returning no records or a filter is too restrictive | Test each Supabase read node separately and review the date filters for checkins and weekly_forms. |
| No clients pass the risk filter | The risk score logic does not produce records that meet the current threshold | Review the JavaScript in Calculate Client Risk Metrics and test with sample data that should clearly qualify. |
| Clients are skipped unexpectedly | The cooldown logic is blocking them because alert_allowed_now is false | Check last_alert_sent_at values and confirm the cooldown rule in the Code node matches your intended timing. |
| Gemini output fails to parse | The model response is not valid JSON or contains extra formatting | Tighten the prompt, keep the JSON only instruction, and inspect the Parse Draft Response node output. |
| Slack messages are not sent | Slack credentials, channel selection, or app permissions are incorrect | Reconnect Slack credentials, verify the target channel, and confirm the app can post messages. |
| Gmail emails are not sent | Gmail OAuth is disconnected or sender permissions are incomplete | Reauthenticate Gmail credentials and send a direct test email from the node. |
| Google Sheets append or update fails | Sheet name, spreadsheet ID, or mapped columns do not match the actual file | Reopen the Sheets nodes and confirm the selected spreadsheet, tab, and column mapping are correct. |
| Supabase update does not change client status | The update filter does not match the intended client row | Confirm that client_id values match exactly between the workflow output and the clients table. |
If you need help importing this workflow, connecting credentials, adjusting the risk logic, refining the Gemini prompt or extending the workflow with additional channels and dashboards, support from an experienced n8n team can make the setup faster and more reliable. WeblineIndia can help with workflow deployment, custom business rules, reporting extensions and similar automation solutions tailored to gym operations, coaching workflows and retention systems.