WhatsApp + Supabase: quizzes that remember each user
Your “quick WhatsApp quiz” starts simple, then turns into a messy loop of repeat questions. “What’s your name again?” “Which topic are we on?” And suddenly you’re scrolling chat history like it’s a database.
This WhatsApp quiz automation hits course creators and coaches hardest, but training leads inside small teams feel it too. You get a quiz assistant that remembers each user’s name and study topic, so every session stays consistent without you babysitting the thread.
Below, you’ll see how the workflow captures user details once, stores them in Supabase, and uses OpenAI to generate fresh quizzes on demand, directly inside WhatsApp.
How This Automation Works
See how this solves the problem:
n8n Workflow Template: WhatsApp + Supabase: quizzes that remember each user
flowchart LR
subgraph sg0["Simple Memory Flow"]
direction LR
n0@{ icon: "mdi:memory", form: "rounded", label: "Simple Memory", pos: "b", h: 48 }
n1@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Whatsapp Trigger"]
n4@{ icon: "mdi:swap-horizontal", form: "rounded", label: "User exist?", pos: "b", h: 48 }
n5@{ icon: "mdi:robot", form: "rounded", label: "AI Agent - Portuguese BR Sys..", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/supabase.svg' width='40' height='40' /></div><br/>Supabase: Fetch User Data"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Ask For Name"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/supabase.svg' width='40' height='40' /></div><br/>Supabase: Update User Name"]
n9@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Quiz Topic Defined?", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Ask For Study Topic (WhatsAp.."]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/supabase.svg' width='40' height='40' /></div><br/>Supabase: Update Study Topic"]
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send Message to User (WhatsA.."]
n2 --> n5
n4 --> n9
n4 --> n7
n7 --> n8
n0 -.-> n5
n3 --> n6
n1 -.-> n5
n9 --> n2
n9 --> n10
n6 --> n4
n11 --> n2
n5 --> n12
n10 --> n11
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n5 ai
class n1 aiModel
class n0 ai
class n4,n9 decision
class n3,n7,n10,n12 api
classDef customIcon fill:none,stroke:none
class n2,n3,n6,n7,n8,n10,n11,n12 customIcon
The Challenge: Personalized quizzes fall apart without memory
Interactive quizzes in WhatsApp are great for engagement, but manually running them is a grind. You’re forced to re-collect basic context (name, topic, level) because chats aren’t structured, and people return days later expecting you to remember everything. The “admin” work is what kills it: checking past messages, copying the topic into a prompt, rewriting the quiz, then sending it back. And if you get the topic wrong once, the user loses trust fast. Honestly, the worst part is the mental load. You’re constantly context switching instead of teaching.
It adds up fast. Here’s where it breaks down in real life.
- People restart conversations mid-week, and you waste time re-asking questions you already asked on day one.
- Topic tracking lives in your head (or a note), so consistency drops the moment you’re busy.
- Manual quiz writing makes “daily practice” unrealistic once you have more than a few users.
- Small mistakes creep in: wrong name, wrong topic, or a quiz that doesn’t match the last session.
The Fix: A WhatsApp quiz assistant that remembers users
This workflow turns WhatsApp messages into a simple, personalized study loop backed by Supabase. When someone texts your WhatsApp number, the automation checks Supabase to see if that person already has a saved profile. Missing a name? It asks for it and stores it. Missing a study topic? Same thing. Once those basics exist, the workflow combines the incoming message with the saved profile data, then sends everything to an AI Agent powered by an OpenAI Chat Model and a short memory buffer. The agent generates a topic-specific quiz, keeping the conversation coherent instead of random. Finally, the quiz is delivered back through WhatsApp automatically, ready for the next interaction.
The workflow starts with an incoming WhatsApp webhook, then branches based on what Supabase returns. After name and topic are confirmed, a Merge step consolidates inputs so the AI Agent can generate consistent questions. The last step pushes the finished quiz back to WhatsApp via HTTP Request.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you run a WhatsApp study group with 30 active learners and you send each person one short quiz per day. Manually, you spend maybe 5 minutes per learner to find their last topic, craft questions, and send the message, which is about 2.5 hours a day. With this workflow, the “work” is basically the user texting in, then waiting a minute for the response. You get those 2 hours back most days, and the experience is more consistent for everyone.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- WhatsApp Cloud API for receiving and sending messages.
- Supabase to store user profiles (name + topic).
- OpenAI API key (get it from the OpenAI dashboard).
Skill level: Intermediate. You’ll connect credentials, paste a webhook URL into WhatsApp, and map a few fields into Supabase.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
A WhatsApp message triggers the workflow. The Incoming WhatsApp Hook receives the message instantly, along with metadata you can use to identify the sender.
The workflow looks up the user in Supabase. A Supabase “retrieve user” step checks if this phone number (or user id) already has a stored profile. Then an If condition validates what exists so you don’t ask for the same details twice.
Missing info gets collected automatically. If the name is missing, the workflow sends a WhatsApp prompt (via HTTP Request) asking for it, then updates Supabase. If the quiz topic is missing, it does the same thing for the study topic. No spreadsheets. No manual follow-up.
OpenAI generates the quiz with context. Once the profile is complete, the Merge node combines the saved profile with the latest user message. The AI Agent (using an OpenAI Chat Model and a brief memory buffer) generates a quiz aligned to the chosen topic, then Deliver WhatsApp Quiz sends it back through WhatsApp.
You can easily modify the quiz style (difficulty, number of questions, language) to match your audience based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Webhook Trigger
Set up the incoming WhatsApp webhook so the workflow can receive user messages.
- Add the Incoming WhatsApp Hook node and set HTTP Method to
POST. - Set Path to
aae5d69a-d682-4d9d-9710-a3807ca73b9c. - Copy the generated webhook URL from Incoming WhatsApp Hook and configure it in your WhatsApp provider.
Step 2: Connect Supabase for User Data
Retrieve and update user records in Supabase to track names and study topics.
- Open Retrieve Supabase User and confirm Operation is set to
select. - Credential Required: Connect your
supabaseApicredentials in Retrieve Supabase User. - Open Update Supabase Name and confirm Operation is set to
update. - Credential Required: Connect your
supabaseApicredentials in Update Supabase Name. - Open Update Supabase Topic and confirm Operation is set to
update. - Credential Required: Connect your
supabaseApicredentials in Update Supabase Topic.
Step 3: Configure User Validation and Prompts
Use conditional logic to decide whether to ask for a name or a study topic before building the quiz.
- In Validate User Presence, define the conditions that identify a known user (currently empty in the workflow).
- In Request User Name, set Method to
POSTand JSON Body to=Bem-vindo(a) ao nosso espaço de estudos! Para que eu possa te ajudar melhor, me conta, qual é o seu nome?. - In Check Quiz Topic, define the conditions that determine if a topic already exists (currently empty in the workflow).
- In Request Study Topic, set Method to
POSTand JSON Body to={{NOME_DO_USUARIO_AQUI}}, pensando em te ajudar nos estudos, qual matéria ou tópico específico prefere para o nosso quiz?.
Step 4: Set Up the AI Quiz Generation
Configure the AI components that generate the personalized quiz in Portuguese.
- Open OpenAI Chat Engine and set Model to
gpt-4o-mini. - Credential Required: Connect your
openAiApicredentials in OpenAI Chat Engine. - Open AI Quiz Guide (PT-BR) and review the System Message to ensure it matches your quiz tone and requirements.
- Link Brief Memory Buffer to AI Quiz Guide (PT-BR) as memory (already connected in the workflow).
Step 5: Configure Output Delivery to WhatsApp
Finalize the flow by sending the generated quiz back to the user.
- Ensure Combine Payloads receives data from both Check Quiz Topic and Update Supabase Topic before feeding AI Quiz Guide (PT-BR).
- Open Deliver WhatsApp Quiz and configure your WhatsApp API request parameters (currently empty in the workflow).
Step 6: Test and Activate Your Workflow
Verify the end-to-end behavior and turn on the workflow for production use.
- Click Execute Workflow and send a test WhatsApp message to the webhook URL from Incoming WhatsApp Hook.
- Confirm that Retrieve Supabase User runs, then Validate User Presence routes correctly to Request User Name or Check Quiz Topic.
- Verify that AI Quiz Guide (PT-BR) produces quiz content and that Deliver WhatsApp Quiz sends it successfully.
- When results look correct, toggle the workflow to Active.
Watch Out For
- Supabase credentials can expire or need specific permissions. If things break, check your Supabase project API settings and table Row Level Security policies first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Common Questions
Usually in about an hour if your Supabase table is ready.
Yes, but you’ll want someone comfortable with connecting accounts and testing webhooks. There’s no coding, though you do need to pay attention to field mapping for “name” and “topic.”
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage (often just a few dollars a month for small groups).
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
You can tweak the quiz behavior in the AI Quiz Guide (PT-BR) agent instructions (tone, number of questions, difficulty). If you want a different “memory” style, adjust the Brief Memory Buffer window so the agent references more or less recent context. Common customizations include adding a “level” field in Supabase, switching the quiz language, and changing the WhatsApp prompts in Request User Name / Request Study Topic.
Most of the time it’s a WhatsApp Cloud API token issue or a webhook mismatch. Confirm your webhook URL matches the Incoming WhatsApp Hook endpoint in n8n, then re-check the verify token (if you use one) and your WhatsApp app permissions. If messages arrive but replies don’t send, it’s usually an HTTP Request configuration problem (wrong endpoint, missing auth header, or an invalid “to” number format). Rate limits can show up too when you blast quizzes to many users at once.
On n8n Cloud, capacity depends on your plan’s monthly executions, and self-hosting is limited mostly by your server. In practice, this workflow is lightweight, so small teams commonly handle dozens (and often hundreds) of daily quiz interactions without changing the design.
Often, yes, because this flow benefits from branching logic, merging data, and an AI agent with memory in one place. Zapier/Make can do parts of it, but the moment you add “check Supabase, ask missing fields, then generate and respond,” the scenario gets long and pricey. n8n also gives you the option to self-host, which is a big deal if usage spikes. Still, if you only need a simple auto-reply, those tools can be quicker. Talk to an automation expert if you want a fast recommendation.
Once this is running, your quizzes stop depending on your memory and your availability. The workflow handles the repeatable bits, and you get to focus on the teaching.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.