Skip to content

EXP - WhatsApp Educational Quiz System

An interactive WhatsApp-based learning platform that delivers educational questions to users, evaluates their responses using AI, provides personalized feedback, and tracks learning progress through Airtable integration.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

Based on the workflow structure, this system appears to serve educational institutions or training programs that need to deliver interactive learning experiences through WhatsApp. It enables learners to receive questions, submit answers via WhatsApp messages, and receive immediate AI-powered feedback while maintaining detailed progress tracking.

How It Works

  1. User Registration: When a new WhatsApp message arrives, the system checks if the user exists in the database by phone number
  2. New User Setup: For first-time users, creates a user record with default settings (starting at lesson 16, question 1)
  3. Question Delivery: Retrieves the current question for the user and sends both text and audio versions via WhatsApp
  4. Response Collection: Uses a webhook wait mechanism to pause execution and collect the user's response
  5. AI Evaluation: Processes the user's answer through an AI agent that evaluates correctness and provides feedback
  6. Progress Tracking: Updates user progress records in Airtable with scores and completion status
  7. Next Steps: Either advances to the next question or marks the lesson as complete based on progress

Workflow Diagram

graph TD
    A[WhatsApp Webhook] --> B[Query User Table]
    B --> C{Is New User?}
    C -->|Yes| D[Create New User Record]
    C -->|No| E[Get Session State]
    D --> F[Get Current Question]
    E --> G[AI Agent]
    F --> H[Send Question Text]
    H --> I[Send Audio]
    I --> J[Store Resume URL]
    J --> K[Respond to Webhook]
    K --> L[Wait for Response]
    L --> M[POST to Resume URL]
    G --> N[Send Question & Audio]
    N --> O[Update Progress Records]

Trigger

  • Type: Webhook (WhatsApp)
  • Method: POST
  • Path: 33898c22-f5f0-45f0-9983-3fd19c2daebb
  • Source: Twilio WhatsApp integration receiving user messages

Nodes Used

Node Type Purpose
Webhook Receives incoming WhatsApp messages from Twilio
HTTP Request Queries and updates Airtable records via API
Airtable Direct integration for user progress tracking
Twilio Sends WhatsApp messages (questions, audio, feedback)
AI Agent Evaluates user responses using OpenAI GPT model
OpenAI Chat Model Provides AI language processing capabilities
If (Conditional) Routes workflow based on user status and progress
Wait Pauses execution to collect user responses
Set (Edit Fields) Formats data for AI processing
Memory Buffer Maintains conversation context for AI agent
Respond to Webhook Returns responses to calling systems

External Services & Credentials Required

Airtable

  • Credential Type: Bearer Token Authentication
  • Required Access: Read/write access to Users, Questions, User Progress, and User Responses tables
  • Base ID: appzp49MGzOjgteaz

Twilio

  • Credential Type: API credentials
  • Required Access: WhatsApp messaging capabilities
  • Account SID: AC906ca9524b640bdad7d029fd565b6a02

OpenAI

  • Credential Type: API Key
  • Required Access: GPT-4 model access for response evaluation
  • Model: gpt-4.1-mini

Environment Variables

No explicit environment variables are defined in this workflow. All configuration is handled through: - Airtable base and table IDs (hardcoded) - Twilio account settings (in credentials) - OpenAI model selection (configured in nodes)

Data Flow

Input

  • WhatsApp message containing:
    • User phone number (WaId)
    • Message body (Body)
    • User profile name (ProfileName)

Processing

  • User lookup and creation in Airtable
  • Question retrieval based on user progress
  • AI-powered response evaluation
  • Progress tracking and score calculation

Output

  • WhatsApp messages (questions, audio, feedback)
  • Updated user records in Airtable
  • Progress tracking data
  • Webhook responses for system integration

Error Handling

The workflow includes basic error handling through: - Conditional routing based on user existence - Fallback paths for new vs. existing users - Resume URL mechanism for handling interrupted flows

However, there are no explicit error catch nodes or retry mechanisms visible in the current implementation.

Known Limitations

Based on the workflow structure: - Limited to lesson 16 with 11 questions maximum - No explicit error recovery for failed API calls - Hardcoded Airtable base and table references - Single-threaded processing (one user at a time per execution) - No timeout handling for user responses

No related workflows are explicitly referenced in this implementation.

Setup Instructions

  1. Import Workflow

    • Import the JSON into your n8n instance
    • Ensure all required nodes are available
  2. Configure Credentials

    • Set up Airtable Personal Access Token with read/write permissions
    • Configure Twilio API credentials with WhatsApp access
    • Add OpenAI API key with GPT-4 access
  3. Airtable Setup

    • Create or verify base appzp49MGzOjgteaz exists
    • Ensure tables exist: Users, Questions, User Progress, User Responses
    • Verify field names match workflow expectations
  4. Twilio Configuration

    • Set up WhatsApp sandbox or production number
    • Configure webhook URL to point to your n8n instance
    • Test message delivery capabilities
  5. Testing

    • Use the pinned data to test workflow execution
    • Verify AI agent responses are appropriate
    • Test the complete user journey from first message to completion
  6. Activation

    • Enable the workflow
    • Monitor initial user interactions
    • Adjust AI prompts and scoring criteria as needed