{"product_id":"n8n-gym-at-risk-alerts-supabase-gemini-slack-gmail","title":"n8n Gym At-Risk Alerts: Supabase + Gemini + Slack + Gmail","description":"\u003ch3\u003eAutomatically alert gym coaches and re-engage at-risk clients—daily\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow scans your \u003cstrong\u003eSupabase\u003c\/strong\u003e gym activity data every day to identify \u003cstrong\u003eat-risk clients\u003c\/strong\u003e, generates a personalized re-engagement email draft with \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e, notifies coaches in \u003cstrong\u003eSlack\u003c\/strong\u003e, and emails clients via \u003cstrong\u003eGmail\u003c\/strong\u003e—while logging every alert back to \u003cstrong\u003eSupabase\u003c\/strong\u003e and \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns on a daily schedule\u003c\/strong\u003e using an n8n schedule trigger.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads active clients\u003c\/strong\u003e plus their relevant activity windows from Supabase: the \u003cstrong\u003elast 14 days of check-ins\u003c\/strong\u003e and \u003cstrong\u003elast 21 days of weekly form submissions\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMerges and calculates engagement metrics\u003c\/strong\u003e per client (e.g., days since last check-in\/form, weekly check-in count, missed activities), then determines a \u003cstrong\u003erisk score\/type\u003c\/strong\u003e and escalation\/cooldown timing.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFilters to high-risk clients\u003c\/strong\u003e and prevents duplicate spam by blocking alerts during a \u003cstrong\u003eduplicate-alert cooldown window\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUses Google Gemini\u003c\/strong\u003e to create a \u003cstrong\u003eshort JSON email draft\u003c\/strong\u003e (subject + body) and formats a \u003cstrong\u003ecoach-facing Slack summary\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends notifications\u003c\/strong\u003e: a Slack alert to the coach channel and a \u003cstrong\u003eGmail message\u003c\/strong\u003e to the client.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLogs and syncs state\u003c\/strong\u003e: writes the risk event to Supabase (\u003ccode\u003erisk_events\u003c\/code\u003e) and appends the same record to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e; then updates alert\/escalation fields in Supabase and syncs them back to the client master sheet.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eIdentify clients missing expected check-ins\/forms and trigger timely coach outreach.\u003c\/li\u003e\n  \u003cli\u003eAutomate re-engagement emails when attendance drops—without manual spreadsheet work.\u003c\/li\u003e\n  \u003cli\u003eMaintain clean alert history with cooldowns, escalation timing, and synchronized reporting.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSupabase\u003c\/strong\u003e: reads from \u003ccode\u003eclients\u003c\/code\u003e, \u003ccode\u003echeckins\u003c\/code\u003e, \u003ccode\u003eweekly_forms\u003c\/code\u003e; writes to \u003ccode\u003erisk_events\u003c\/code\u003e and updates alert state\/escalation fields.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Gemini (PaLM)\u003c\/strong\u003e: generates the email draft as JSON.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSlack\u003c\/strong\u003e: posts coach-facing alerts and summaries.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGmail\u003c\/strong\u003e: sends the client email message.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\u003c\/strong\u003e include: if, set, code, merge, slack, and gmail.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45978931658931,"sku":"N8N-19314","price":11.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/4vu4Im7ve7EjTKyczv3BH_86h2snM3.png?v=1788859831","url":"https:\/\/buyflowscripts.com\/products\/n8n-gym-at-risk-alerts-supabase-gemini-slack-gmail","provider":"N8N Commerce","version":"1.0","type":"link"}