Audio-Visual Trainer Analysis Workflow¶
This n8n workflow provides automated analysis of trainer video recordings, evaluating speech patterns, engagement levels, and overall presentation quality. It processes video files through speech-to-text transcription and AI-powered analysis to generate comprehensive performance reports with actionable feedback for trainer improvement.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
How It Works¶
- Receives Analysis Request: The workflow starts when triggered by a webhook containing video analysis request data including recording metadata and callback information
- Extracts Payload Data: Parses the incoming request to extract analysis ID, recording ID, video URL, and recording details
- Prepares Transcription: Configures the video for speech-to-text processing with optimized settings for trainer content
- Submits to AssemblyAI: Sends the video to AssemblyAI's transcription service with enhanced settings for training content
- Waits for Processing: Pauses execution for 10 seconds to allow transcription processing to begin
- Retrieves Transcription: Fetches the completed transcript with word-level timing data
- Analyzes Speech Patterns: Processes the transcript to identify filler words, pauses, speaking pace, and clarity metrics
- Performs AI Analysis: Uses GPT-4 to evaluate overall trainer performance and generate specific recommendations
- Calculates Engagement: Analyzes the transcript for interactive elements, questions, and audience engagement indicators
- Compiles Final Report: Combines all analysis results into a comprehensive report with scores and recommendations
- Sends Results: Delivers the complete analysis back to the requesting application via callback
- Returns Response: Confirms successful processing initiation to the original requester
Workflow Diagram¶
graph TD
A[Webhook Trigger] --> B[Extract Payload]
B --> C[Prepare for Transcription]
C --> D[Submit to AssemblyAI]
D --> E[Wait for Processing]
E --> F[Get Transcription Result]
F --> G[Analyze Speech Patterns]
G --> H[AI Performance Analysis]
G --> I[Engagement Analysis]
H --> J[Compile Final Report]
I --> J
J --> K[Send Results to App]
J --> L[Code]
K --> M[Webhook Response]
N[Error Handler] --> O[Send Error Callback]
Trigger¶
Webhook: POST /analyze-trainer-video
- Accepts video analysis requests with recording metadata
- Expects JSON payload containing analysis ID, recording details, and callback URL
- Responds immediately with processing confirmation while analysis runs asynchronously
Nodes Used¶
| Node Type | Node Name | Purpose |
|---|---|---|
| Webhook | Webhook Trigger | Receives incoming video analysis requests |
| Code | Extract Payload | Parses and validates incoming request data |
| Code | Prepare for Transcription | Configures video for speech-to-text processing |
| HTTP Request | Submit to AssemblyAI | Initiates video transcription with AssemblyAI |
| Wait | Wait for Processing | Pauses execution to allow transcription processing |
| HTTP Request | Get Transcription Result | Retrieves completed transcript from AssemblyAI |
| Function | Analyze Speech Patterns | Analyzes transcript for filler words, pauses, and pace |
| HTTP Request | AI Performance Analysis | Uses GPT-4 to evaluate trainer performance |
| Function | Engagement Analysis | Calculates audience engagement metrics |
| Function | Compile Final Report | Combines all analysis into comprehensive report |
| HTTP Request | Send Results to App | Delivers analysis results via callback |
| Respond to Webhook | Webhook Response | Returns processing confirmation |
| Function | Error Handler | Formats error responses for failed analyses |
| HTTP Request | Send Error Callback | Sends error notifications to requesting app |
| Code | Code | Additional processing node |
External Services & Credentials Required¶
AssemblyAI¶
- Purpose: Speech-to-text transcription with word-level timing
- Credentials: API key (currently hardcoded - should be moved to environment variables)
- Features Used: Language detection, speaker labels, punctuation, text formatting
OpenAI GPT-4¶
- Purpose: AI-powered trainer performance analysis and recommendations
- Credentials: OpenAI API key (stored in n8n credentials as "OpenAi account")
- Model: GPT-4 for comprehensive analysis and feedback generation
Supabase¶
- Purpose: Callback endpoint for delivering analysis results
- Endpoint:
https://ecwihbiaztxsfouvqzam.supabase.co/functions/v1/video-analysis-callback - Authentication: Bearer token (anon)
Environment Variables¶
The workflow currently uses hardcoded values that should be moved to environment variables:
ASSEMBLYAI_API_KEY: AssemblyAI API key for transcription servicesSUPABASE_CALLBACK_URL: Base URL for Supabase callback functionsSUPABASE_ANON_KEY: Supabase anonymous access key
Data Flow¶
Input¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Output¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
Error Handling¶
The workflow includes comprehensive error handling:
- Error Handler Node: Catches processing failures and formats error responses
- Send Error Callback: Notifies the requesting application of analysis failures
- Graceful Degradation: Returns structured error responses matching expected format
- Timeout Protection: HTTP requests include timeout settings to prevent hanging
- Continue on Fail: Error callback requests are configured to continue even if delivery fails
Error responses include: - Analysis and recording IDs for tracking - Error type and descriptive message - Timestamp of failure - Null values for analysis fields that couldn't be computed - Fallback recommendations suggesting retry
Known Limitations¶
Based on the workflow implementation:
- AssemblyAI API key is hardcoded and should be moved to secure credential storage
- Fixed 10-second wait time may not be sufficient for longer videos
- Single transcription attempt with no retry logic for failed transcriptions
- Engagement analysis uses simple heuristics rather than advanced NLP
- No validation of video file format or size before processing
- Limited error context when transcription fails
Related Workflows¶
No related workflows identified in the current implementation.
Setup Instructions¶
-
Import Workflow
- Copy the workflow JSON into n8n
- The workflow will be imported with the name "Audio-Visual"
-
Configure Credentials
- Set up OpenAI API credentials in n8n with the name "OpenAi account"
- Update the hardcoded AssemblyAI API key in the "Submit to AssemblyAI" and "Get Transcription Result" nodes
-
Environment Setup
- Verify the Supabase callback URL matches your application's endpoint
- Ensure the webhook path
/analyze-trainer-videois accessible - Configure any firewall rules to allow incoming webhook requests
-
Test Configuration
- Send a test request to the webhook endpoint with sample video data
- Verify transcription processing completes successfully
- Confirm analysis results are delivered to the callback endpoint
-
Production Deployment
- Move hardcoded API keys to secure credential storage
- Set up monitoring for failed transcriptions
- Configure appropriate timeout values based on expected video lengths
- Implement retry logic for failed API calls if needed
-
Activate Workflow
- Enable the workflow in n8n
- The webhook will be available at:
https://your-n8n-instance/webhook/analyze-trainer-video