Track fitness class attendance and retention with n8n, Google Sheets, and AI
Webhook check-in → Google Sheets member lookup → AI engagement label & personalized message → log, email, and Discord alert → weekly retention report every Monday
- Who
- Fitness studio operators or small-gym admins who want automated member management
- You get
- Automatically log class check-ins, identify at-risk members, send personalized follow-ups, and deliver a weekly retention digest to managers
- You need
- n8n · google-sheets · gmail · discord
Constraints
Requires an n8n instance and credentials for: Google Sheets OAuth2, OpenAI API, Gmail OAuth2, Discord Bot. A front-desk or check-in system must POST JSON to the webhook URL.
What they did
Template author khmuhtadin published an n8n workflow for fitness studio automation. It receives check-ins via webhook, matches members in Google Sheets, calls OpenAI gpt-4o-mini to label engagement and draft a personalized message, logs attendance, sends emails via Gmail, and posts alerts and a weekly report to Discord.
How it went
The source demonstrates the full workflow structure and node configurations (author_report). The template contains 36 nodes covering check-in intake, validation, member matching, AI message generation, logging, email notifications, Discord alerts, and a scheduled weekly report.
Worth knowing
1) AI output requires strict JSON format; the Parse Agent Output node includes fallback logic for malformed responses. 2) Weekly no-show rate and at-risk classification are computed by the Compute Weekly Stats node based on a 14-day absence window for members who joined more than 30 days ago. 3) No actual runtime data or ROI is provided by the source. 4) Discord and Gmail studio recipient addresses must be replaced with real ones. 5) The default timezone is Asia/Jakarta; adjust as needed.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Read Member Roster node: connect Google Sheets OAuth2 credentials.
- Engagement Model node: connect OpenAI API credentials.
- Append Check-in to Log node: connect Google Sheets OAuth2 credentials.
- Email Member Message node: connect Gmail OAuth2 credentials.
- Alert Manager on Discord node: connect discordBotApi credentials.
- Alert Invalid on Discord node: connect discordBotApi credentials.
- Email Invalid Notice node: connect Gmail OAuth2 credentials.
- Alert Unknown on Discord node: connect discordBotApi credentials.
- Email Unknown Notice node: connect Gmail OAuth2 credentials.
- Read Attendance for Report node: connect Google Sheets OAuth2 credentials.
- Read Roster for Report node: connect Google Sheets OAuth2 credentials.
- Insight Model node: connect OpenAI API credentials.
- Email Weekly Report node: connect Gmail OAuth2 credentials.
- Post Weekly Report on Discord node: connect discordBotApi credentials.
Configuration to replace
- Source template is n8n public workflow #18763 (~36 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Prepare spreadsheets and credentials
Create two tabs in Google Sheets: MemberRoster and AttendanceLog. Ensure columns include member_id, member_name, member_email, membership, join_date, checkin_date, status, etc. In n8n, configure the matching credentials: Google Sheets OAuth2, OpenAI API, Gmail OAuth2, and Discord Bot.
Configure webhook trigger and input validation
Set up a Webhook node in n8n with path fitness/checkin and method POST. The front-desk system sends JSON with member_id, class_name, status, and optional notes. The Normalize Check-in node generates a checkin_id and standardizes fields. The Validate Check-in Input node checks that member_id and class_name are present; if missing, it triggers Discord and Gmail alerts.
Execution prompt · Source text。Alert Invalid on Discord node content field
={{ 'Invalid check-in rejected: member_id=' + $json.member_id + ' class=' + $json.class_name + ' at ' + $json.received_at + '. Missing required fields.' }}Match member roster
The Read Member Roster node reads the MemberRoster sheet from Google Sheets. The Match Member by ID node uses a Code node to match the check-in member_id against the roster and extract member_name, member_email, membership, join_date. If not found, it triggers Discord and Gmail unknown-member alerts.
Execution prompt · Source text。Alert Unknown on Discord node content field
={{ 'Unknown member check-in: id=' + $json.member_id + ' class=' + $json.class_name + ' at ' + $json.received_at + '. Member not in roster; no email sent.' }}AI judges engagement and drafts a message
The Build Agent Input node assembles member and check-in context for the AI Agent node. AI Judge Engagement and Write Message uses gpt-4o-mini to label engagement (at_risk/new/engaged) based on check-in status and generate a short personalized message under 50 words. Parse Agent Output parses the AI-returned JSON, extracts engagement_status and message, and flags needs_attention.
Execution prompt · Source text。AI Judge Engagement and Write Message node text field (user input)
={{ 'Member: ' + $json.member_name + ' | membership: ' + $json.membership + ' | class today: ' + $json.class_name + ' | check-in status: ' + $json.status + ' | notes: ' + $json.notes + ' | joined: ' + $json.join_date + ' | new member: ' + $json.is_new + ' | received at: ' + $json.received_at }}Execution prompt · Source text。AI Judge Engagement and Write Message node options.systemMessage field
You are the member experience assistant for a small fitness studio. A front desk class check-in just came in. Judge the member engagement: at_risk when the check-in status is no_show (write a warm, gentle nudge encouraging them to come back soon, never blaming them); new when the member joined within the last 30 days (write a short encouraging note that helps them build the habit); otherwise engaged (write a brief warm thank you). Write ONE short message under 50 words addressed to the member by first name. Never mention internal metrics or algorithms. Return ONLY valid JSON with double quoted keys and no code fences: {\"engagement_status\":\"at_risk|new|engaged\",\"message\":\"...\"}. No markdown, no emojis, no text outside the JSON.Log check-in and send notifications
Build Check-in Log Row formats the record; Append Check-in to Log writes it to the AttendanceLog sheet. Build Member Message assembles the email content; Email Member Message sends it via Gmail. If needs_attention is true (at_risk or no_show), Alert Manager on Discord posts a retention alert to the manager channel.
Execution prompt · Source text。Alert Manager on Discord node content field
={{ 'Retention alert: ' + $('Build Check-in Log Row').item.json.member_name + ' | class ' + $('Build Check-in Log Row').item.json.class_name + ' | status ' + $('Build Check-in Log Row').item.json.status + ' | AI ' + $('Build Check-in Log Row').item.json.engagement_status + '. Follow up to keep them engaged.' }}Weekly scheduled retention report
Weekly Insights Trigger fires every Monday at 09:00 (cron: 0 9 * * 1). Compute Weekly Stats reads AttendanceLog and MemberRoster to calculate weekly check-ins, unique members, class breakdown, no-show rate, at-risk members (no check-in for 14+ days, joined >30 days ago), and new members (joined within 7 days). AI Write Weekly Insight uses gpt-4o-mini to generate a friendly digest under 120 words. Parse Weekly Insight parses the output, then Email Weekly Report sends it via Gmail and Post Weekly Report on Discord pushes it to the server.
Execution prompt · Source text。AI Write Weekly Insight node text field (user input)
={{ 'Write the weekly studio report. Data: ' + $json.stats_blob }}Execution prompt · Source text。AI Write Weekly Insight node options.systemMessage field
You are the studio analytics assistant for a small fitness studio. Given the weekly attendance stats, write a friendly digest under 120 words for the studio owner: total check-ins, unique members, the busiest class, no-show count and rate, any members at risk of churn, and new members for the week. End with one actionable recommendation. If the week was quiet or there was no data, say so plainly. Return ONLY valid JSON: {\"digest\":\"...\"}. No markdown, no emojis, no text outside the JSON.Execution prompt · Source text。Post Weekly Report on Discord node content field
={{ 'Weekly studio report: ' + $('Parse Weekly Insight').item.json.total_checkins + ' check-ins, ' + $('Parse Weekly Insight').item.json.unique_members + ' members, ' + $('Parse Weekly Insight').item.json.no_show_rate + '% no-show.\n' + $('Parse Weekly Insight').item.json.digest }}
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant: confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are setting up an n8n workflow to track fitness class attendance and member retention. Please confirm first: 1) Google Sheets has MemberRoster and AttendanceLog tabs with matching column headers; 2) n8n credentials are configured for Google Sheets OAuth2, OpenAI API, Gmail OAuth2, and Discord Bot; 3) the front-desk system can POST to /fitness/checkin. Then import workflow.json or configure nodes manually following the step descriptions.
Check Google Sheets column headers and credential permissions before configuring the webhook URL for your check-in system.
Source
Track fitness class attendance and retention with Google Sheets, gpt-5.6-terra, Gmail, and Discord · khmuhtadin · n8n.io · 2026-08-27
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.