EXP (Experimental Workflow)¶
An experimental WhatsApp-based educational quiz system that uses AI to evaluate student responses and provide personalized feedback. This workflow serves as a testing ground for new features before they're moved to production, including AI agent configurations, tool integrations, and prototype functionalities.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
This experimental workflow appears to be designed for testing educational features, specifically: - Interactive WhatsApp-based learning experiences - AI-powered response evaluation using OpenAI - Student progress tracking through Airtable - Automated feedback delivery via Twilio
⚠️ Warning: This workflow shares the same webhook path as production PBA workflows and should only be activated during testing phases to avoid conflicts.
How It Works¶
- User Registration: When a new WhatsApp message arrives, the system checks if the user exists in Airtable
- New User Setup: For new users, creates a user record with default settings (Lesson 16, Question 1)
- Question Delivery: Retrieves the current question from Airtable and sends both text and audio versions via WhatsApp
- Response Collection: Stores a resume URL in the user record and waits for the student's response
- AI Evaluation: When a response arrives, an OpenAI-powered AI agent evaluates the answer against predefined criteria
- Feedback Delivery: Sends personalized feedback and scoring information back to the student
- Progress Tracking: Updates user progress in Airtable and determines next steps
- Continuation: Either moves to the next question or completes the lesson 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]
H --> I[Send Audio]
I --> J[Respond to Webhook]
J --> K[Store Resume URL]
K --> L[Wait for Response]
L --> M[POST to Resume URL]
G --> N{Evaluation Logic}
N --> O[Send Feedback]
O --> P[Update Progress]
P --> Q{Last Question?}
Q -->|Yes| R[Send Completion]
Q -->|No| S[Continue to Next]
Trigger¶
- Type: Webhook (HTTP POST)
- Path:
/webhook/33898c22-f5f0-45f0-9983-3fd19c2daebb - Source: WhatsApp messages via Twilio
- Method: POST
- Status: Currently disabled (experimental use only)
Nodes Used¶
| Node Type | Purpose |
|---|---|
| Webhook | Receives WhatsApp messages from Twilio |
| HTTP Request | Queries and updates Airtable records |
| Airtable | Manages user data, questions, and progress |
| Twilio | Sends WhatsApp messages (text and audio) |
| AI Agent | Evaluates student responses using OpenAI |
| OpenAI Chat Model | Provides AI language processing capabilities |
| Wait | Pauses execution for user responses |
| If | Conditional logic for user flow control |
| Set | Data transformation and field mapping |
| Memory Buffer | Maintains conversation context |
| Respond to Webhook | Returns responses to webhook calls |
External Services & Credentials Required¶
Required Services¶
- Twilio: WhatsApp Business API integration
- OpenAI: GPT model for response evaluation
- Airtable: Database for users, questions, and progress tracking
Credentials Needed¶
- Twilio Account SID and Auth Token
- OpenAI API Key
- Airtable Personal Access Token
- Airtable Base ID:
appzp49MGzOjgteaz
Airtable Tables¶
- Users: Student profiles and current progress
- Questions: Quiz questions with evaluation criteria
- User Progress: Detailed progress tracking
- User Responses: Historical response data
Environment Variables¶
No specific environment variables are configured in this workflow. All credentials are managed through n8n's credential system.
Data Flow¶
Input¶
- WhatsApp message data from Twilio webhook
- User phone number (WaId)
- Message body (student response)
- Profile name
Processing¶
- User lookup and creation
- Question retrieval and delivery
- AI-powered response evaluation
- Progress calculation and updates
Output¶
- WhatsApp messages (questions, audio, feedback)
- Updated Airtable records
- Resume URLs for conversation continuity
- Webhook responses for flow control
Error Handling¶
The workflow includes basic error handling through: - Conditional logic for new vs. existing users - Disabled nodes to prevent execution conflicts - Resume URL mechanism for conversation recovery
However, comprehensive error handling appears limited in this experimental version.
Known Limitations¶
- Webhook Conflict: Shares webhook path with production workflows
- Experimental Status: Not intended for production use
- Limited Error Handling: Basic error recovery mechanisms
- Single Lesson Focus: Appears hardcoded to Lesson 16
- Manual Activation Required: Must be manually enabled/disabled for testing
Related Workflows¶
- PBA Workflows: Production workflows that share the same webhook endpoint
- Tool Workflows: Referenced as dependencies for the AI agent functionality
Setup Instructions¶
1. Import Workflow¶
- Copy the workflow JSON
- Import into your n8n instance
- Ensure all required nodes are available
2. Configure Credentials¶
- Set up Twilio credentials with Account SID and Auth Token
- Add OpenAI API key for GPT model access
- Configure Airtable credentials with Personal Access Token
- Verify Airtable base access to
appzp49MGzOjgteaz
3. Airtable Setup¶
Ensure these tables exist with proper fields: - Users: Phone Number, Name, Current Lesson, Current Question Index, Resume URL - Questions: Question Number, Question Text, Intro Audio URL, evaluation criteria - User Progress: User links, scores, completion status
4. Testing Protocol¶
- Deactivate all production PBA workflows
- Activate this experimental workflow
- Test features thoroughly
- Document findings and issues
- Deactivate this workflow
- Reactivate production workflows
5. Webhook Configuration¶
- Configure Twilio to send WhatsApp messages to the webhook URL
- Ensure webhook path doesn't conflict with active workflows
- Test webhook connectivity before activation
6. AI Agent Configuration¶
- Verify OpenAI model selection (currently gpt-4.1-mini)
- Test AI evaluation prompts with sample responses
- Adjust scoring criteria as needed
⚠️ Important: Keep this workflow disabled unless actively testing to prevent conflicts with production systems.