Skip to content

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

  1. Receives Analysis Request: The workflow starts when triggered by a webhook containing video analysis request data including recording metadata and callback information
  2. Extracts Payload Data: Parses the incoming request to extract analysis ID, recording ID, video URL, and recording details
  3. Prepares Transcription: Configures the video for speech-to-text processing with optimized settings for trainer content
  4. Submits to AssemblyAI: Sends the video to AssemblyAI's transcription service with enhanced settings for training content
  5. Waits for Processing: Pauses execution for 10 seconds to allow transcription processing to begin
  6. Retrieves Transcription: Fetches the completed transcript with word-level timing data
  7. Analyzes Speech Patterns: Processes the transcript to identify filler words, pauses, speaking pace, and clarity metrics
  8. Performs AI Analysis: Uses GPT-4 to evaluate overall trainer performance and generate specific recommendations
  9. Calculates Engagement: Analyzes the transcript for interactive elements, questions, and audience engagement indicators
  10. Compiles Final Report: Combines all analysis results into a comprehensive report with scores and recommendations
  11. Sends Results: Delivers the complete analysis back to the requesting application via callback
  12. 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 services
  • SUPABASE_CALLBACK_URL: Base URL for Supabase callback functions
  • SUPABASE_ANON_KEY: Supabase anonymous access key

Data Flow

Input

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "analysisId": "unique-analysis-id",
  "recordingId": "recording-identifier", 
  "callbackUrl": "callback-endpoint-url",
  "timestamp": "analysis-request-timestamp",
  "recording": {
    "title": "Training Session Title",
    "description": "Session description",
    "file_url": "video-file-url",
    "duration_seconds": 1800,
    "session_duration_minutes": 30
  }
}

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
{
  "analysisId": "unique-analysis-id",
  "recordingId": "recording-identifier",
  "status": "success",
  "filler_words": {
    "total_count": 15,
    "percentage": 3.2,
    "breakdown": {"um": 8, "uh": 7},
    "score": 8,
    "assessment": "good"
  },
  "pauses_analysis": {
    "total_pauses": 12,
    "average_duration": 1.5,
    "assessment": "good",
    "score": 7
  },
  "pace_analysis": {
    "words_per_minute": 145,
    "rating": "good",
    "score": 8,
    "assessment": "optimal"
  },
  "engagement_score": {
    "score": 7.2,
    "assessment": "highly_engaging",
    "factors": {
      "questions_asked": 8,
      "interactive_phrases": 12
    }
  },
  "transcript": "Full session transcript...",
  "recommendations": {
    "priority_actions": ["Specific improvement suggestions"],
    "strengths": ["Identified strong points"],
    "improvement_areas": ["Areas needing work"],
    "overall_summary": "Comprehensive performance summary"
  },
  "detailed_analysis": {
    "overall_score": 7.5,
    "grade": "B",
    "component_scores": {
      "clarity": 8,
      "pace": 8,
      "engagement": 7.2,
      "overall": 7.5
    }
  }
}

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

No related workflows identified in the current implementation.

Setup Instructions

  1. Import Workflow

    • Copy the workflow JSON into n8n
    • The workflow will be imported with the name "Audio-Visual"
  2. 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
  3. Environment Setup

    • Verify the Supabase callback URL matches your application's endpoint
    • Ensure the webhook path /analyze-trainer-video is accessible
    • Configure any firewall rules to allow incoming webhook requests
  4. 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
  5. 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
  6. Activate Workflow

    • Enable the workflow in n8n
    • The webhook will be available at: https://your-n8n-instance/webhook/analyze-trainer-video