Audio Reports Copy¶
A WhatsApp-based mentor assessment system that enables program team members to evaluate mentors through conversational AI, supporting both text and voice note interactions with automated transcription and mentor data lookup.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
How It Works¶
This workflow operates as a WhatsApp chatbot for mentor assessment with the following flow:
- Message Reception: Receives WhatsApp messages via Twilio webhook
- Message Processing: Extracts phone numbers, detects mentor IDs (6-digit codes), and identifies voice notes
- Voice Note Handling: Downloads and transcribes audio messages using OpenAI Whisper
- Mentor Data Lookup: Queries Google Sheets database when mentor IDs are provided
- Conversation Management: Uses AI agents with memory to conduct personalized assessments
- Response Generation: Sends contextual responses back via WhatsApp
The system supports three main conversation paths: - Voice Note Processing: Transcribes audio and continues assessment - Mentor ID Confirmation: Looks up mentor data and begins structured assessment - General Conversation: Handles ongoing assessment dialogue with memory
Mermaid Diagram¶
graph TD
A[WhatsApp Webhook3] --> B[Extract Message Info2]
B --> C{Has Voice Note?}
C -->|Yes| D[Download Voice File2]
D --> E[Transcribe a recording]
E --> F[AI Summary]
F --> G[Send Response3]
C -->|No| H{Has Mentor ID?}
H -->|Yes| I[Get row(s) in sheet]
I --> J[Code]
J --> K[AI Confirming Mentor_ID]
K --> L[Send Response4]
H -->|No| M[AI Normal Conversation]
M --> N[Send Response2]
O[Simple Memory3] -.-> K
P[Simple Memory4] -.-> F
Q[Simple Memory] -.-> M
R[OpenAI Chat Model6] -.-> K
S[OpenAI Chat Model7] -.-> F
T[OpenAI Chat Model] -.-> M
Trigger¶
WhatsApp Webhook - Activated when users send messages to the configured Twilio WhatsApp number. The webhook receives POST requests containing message data, media attachments, and sender information.
Nodes Used¶
| Node Type | Purpose |
|---|---|
| Webhook | Receives incoming WhatsApp messages from Twilio |
| Code | Extracts message info, detects mentor IDs, processes conversation data |
| HTTP Request | Downloads voice files and handles API calls |
| Google Sheets | Looks up mentor data from spreadsheet database |
| OpenAI Transcription | Converts voice notes to text using Whisper |
| LangChain AI Agent | Manages conversational AI with different personas |
| LangChain Memory | Maintains conversation context across interactions |
| Twilio | Sends WhatsApp responses back to users |
| If (Conditional) | Routes workflow based on message type and content |
External Services & Credentials Required¶
- Twilio: WhatsApp messaging service
- Account SID and Auth Token
- WhatsApp sandbox or approved number
- OpenAI: AI model access and transcription
- API key with GPT-4 and Whisper access
- Google Sheets: Mentor database storage
- Service account credentials
- Sheet ID:
1Vv_gTpvI8RHPPrn0iwzypG3qKRYeLDb1HZFPDzYe5ng
Environment Variables¶
No explicit environment variables are defined in this workflow. Configuration is handled through: - Credential storage in n8n - Direct API key references in HTTP headers - Google Sheets document and sheet IDs
Data Flow¶
Input: - WhatsApp messages with text or voice notes - Mentor IDs (6-digit numbers) - User profile information from Twilio
Processing: - Voice transcription to text - Mentor data lookup from Google Sheets - AI-powered conversation management - Memory-based context retention
Output: - WhatsApp text responses - Assessment summaries - Mentor evaluation reports
Error Handling¶
The workflow includes basic error handling in the message extraction code node, which returns error objects with success flags when processing fails. However, most nodes lack comprehensive error handling, which could lead to workflow failures if external services are unavailable.
Known Limitations¶
- Contains hardcoded OpenAI API keys in HTTP headers (security risk)
- Limited error handling across most nodes
- No retry mechanisms for failed API calls
- Workflow contains disabled duplicate nodes suggesting incomplete refactoring
- Voice note processing depends on Twilio's media URL availability
Related Workflows¶
No related workflows are explicitly mentioned in the current configuration.
Setup Instructions¶
-
Import Workflow: Import the JSON into your n8n instance
-
Configure Credentials:
- Set up Twilio API credentials with your account details
- Add OpenAI API credentials for GPT-4 and Whisper access
- Configure Google Service Account for Sheets access
-
Update Configuration:
- Replace hardcoded API keys with credential references
- Update Google Sheets document ID if using different mentor database
- Configure webhook URL in Twilio console
-
Test Setup:
- Send test message to WhatsApp number
- Verify voice note transcription works
- Test mentor ID lookup functionality
-
Security Hardening:
- Remove hardcoded API keys from HTTP headers
- Use n8n credential system for all external service access
- Enable webhook signature verification
-
Activate Workflow: Enable the workflow to start receiving WhatsApp messages