Quick overview
This workflow runs weekly to pull student attendance and score data from Supabase, uses Google Gemini to generate per-student performance summaries and attention flags, sends immediate WhatsApp alerts for flagged students, then compiles all summaries into a PDF report, uploads it, and shares it with the coach via WhatsApp.
How it works
- Runs weekly on a schedule.
- Fetches all student weekly metrics (attendance and scores) from Supabase.
- Uses Google Gemini to write a short performance summary per student and determine whether the student should be flagged for attention based on attendance and score-drop rules.
- If a student is flagged, sends a WhatsApp message to the coach and inserts a flag record into Supabase.
- Aggregates all students’ summaries into a single HTML weekly report.
- Converts the HTML report to a PDF via an HTTP-based HTML-to-PDF API, uploads the PDF to a file-hosting API, and sends the PDF link/document to the coach via WhatsApp.
- Logs the report URL to Supabase for recordkeeping.
Setup
- Add Supabase credentials and create the required tables/columns (weekly_student_data, attention_flags, and weekly_reports) referenced by the workflow.
- Add a Google Gemini (PaLM) API credential for the chat model used to generate summaries and flags.
- Add WhatsApp Business Cloud credentials, and set your WhatsApp phone number ID and the coach’s recipient number in the configuration values.
- Provide an HTML-to-PDF API endpoint and API key, plus a file upload/hosting API endpoint and API key, and update the configuration fields accordingly.
- Confirm the upload API response field used for the public file URL (assumed to be
url) and adjust the workflow if your provider returns a different field.
- Set the preferred day/time in the weekly schedule trigger and activate the workflow.