Automation library · Chat assistants

Detect at-risk gym clients with Supabase and Gemini

Started by a clock, and works across Gmail, Google Sheets, Slack and Supabase. It hands the judgement calls to Gemini. 17 steps, 2 branches: a working afternoon to understand properly.

MediumCalls a model: Gemini

17 stepsMedium: a working afternoon
2Branches: places the flow splits
0Loops or waits
4Services it connects to

The flow

Starts it 1Model 1Logic 6Service 9

The steps in the order they run, from what starts it.

  1. 1Daily Risk Scan TriggerSchedule triggerStarts it
  2. 2Load Active Clients from SupabaseSupabaseService
  3. 3Load Checkins from SupabaseSupabaseService
  4. 4Load Weekly Forms from SupabaseSupabaseService
  5. 5Merge Client Activity DatasetsMergeLogic
  6. 6Calculate Client Risk MetricsCodeLogic
  7. 7High Risk ClientsIfLogic
  8. 8Check Duplicate Alert WindowIfLogic
  9. 9Prepare Alert and AI Input PayloadSetLogic
  10. 10Generate Re Engagement Draft with GeminiGoogle GeminiModel
  11. 11Parse Draft ResponseCodeLogic
  12. 12Send Coach Slack AlertSlackService
  13. 13Send Client Gmail MessageGmailService
  14. 14Append Risk Log to SupabaseSupabaseService
  15. 15Append Risk Log to Google SheetsGoogle SheetsService
  16. 16Update Client Alert State in SupabaseSupabaseService
  17. 17Update Client Alert State in SheetsGoogle SheetsService

How it's built

Starts on
A clock
Steps
17, with 2 branches
Size
Medium: a working afternoon
Connects to
Gmail, Google Sheets, Slack, Supabase
Model
Gemini

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets, Slack and Supabase accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls Gemini. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 17 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 17 steps before you point it at anything that matters.