Quick Overview
This workflow captures fitness class check-ins via a webhook, looks up members in Google Sheets, uses OpenAI to classify engagement and draft a short message, logs attendance back to Google Sheets, emails members via Gmail, and sends Discord alerts plus a weekly AI-written retention report.
How it works
- Receives a POST webhook check-in event with member_id, class_name, status, and optional notes.
- Normalizes the payload, rejects missing required fields, and sends a Discord alert plus a Gmail email to the studio address for invalid entries.
- Reads the MemberRoster tab in Google Sheets, matches the check-in by member_id, and alerts on Discord plus emails the studio address if the member is not found.
- Sends the matched member and check-in context to an OpenAI-powered agent to label engagement (at_risk/new/engaged) and generate a short personalized message.
- Appends the check-in, engagement label, and generated message to the AttendanceLog tab in Google Sheets.
- Emails the generated message to the member via Gmail and posts a Discord retention alert when the member is flagged as needing attention (for example, a no-show).
- Runs every Monday morning, computes weekly attendance and churn-risk stats from Google Sheets, uses OpenAI to write a short digest, then emails the report via Gmail and posts it to Discord.
Setup
- Create a Google Sheets spreadsheet with MemberRoster and AttendanceLog tabs and ensure the columns used in the workflow (for example member_id, member_name, member_email, membership, join_date, checkin_date, status) exist.
- Add Google Sheets OAuth2 credentials and update the spreadsheet document ID and sheet names if you are not using the provided ones.
- Add an OpenAI API credential (ChatGPT model) for the engagement message and weekly insight agent steps.
- Add Gmail OAuth2 credentials and update the studio/manager email recipients and member email handling as needed.
- Add Discord bot credentials and set the target server (guild) and channel IDs for invalid, unknown-member, retention alerts, and weekly report posts.
- Copy the webhook URL for /fitness/checkin and configure your front desk or check-in system to POST events to it.