A patient arrives at your clinic, fills out intake forms, and leaves with a pamphlet about their condition. Three days later, your nurse spends an hour creating a custom education video, recording voiceovers, and uploading it to the patient portal. Next week, another patient with the same diagnosis arrives, and the process repeats. This isn't efficiency; it's theatre. The problem is simple: healthcare providers have the information needed to generate personalised patient education content the moment intake concludes, yet most still create it manually afterwards. Between Freed AI's real-time clinical documentation, HeyGen's talking-avatar video generation, and ElevenLabs' voice synthesis, you can build a workflow that transforms a completed intake form into a finished education video within minutes, with zero human intervention in the middle. This post walks through building exactly that. We'll wire Freed AI to capture clinical notes from an intake consultation, feed those notes into Claude to extract key education points, generate video scripts, synthesise narration, and assemble a talking-head video. All automatically. All within 15 minutes of the patient leaving the room.
The Automated Workflow
We'll use n8n as the orchestration engine here, because its visual workflow builder makes it straightforward to manage the multi-step handoffs between APIs and services. Make or Zapier would work too, but n8n gives you more control over request formatting and error handling without monthly seat overages.
Step 1: Capture Clinical Notes from Freed AI
Freed AI integrates with most EHR systems and produces HIPAA-compliant transcripts from consultation audio or notes. Your intake consultation is already happening; Freed AI just captures it and pushes structured data to your n8n webhook. Set up a webhook in n8n that listens for a POST request from Freed AI. Configure Freed AI to send the patient's chief complaint, diagnosis, relevant history, and any medication information to your webhook URL whenever a consultation finishes.
POST /webhook/intake-complete
Content-Type: application/json { "patient_id": "PT_12345", "patient_name": "Jane Smith", "diagnosis": "Type 2 Diabetes", "chief_complaint": "Recent diagnosis, needs education on diet and medication", "medications": ["Metformin 500mg twice daily"], "consultation_notes": "Patient concerned about diet restrictions and long-term management...", "timestamp": "2026-03-10T14:30:00Z"
}
n8n receives this payload and triggers your workflow.
Step 2: Extract Education Points with Claude
Next, feed the consultation notes into Claude Opus 4.6. Claude is better than faster models for this task because clinic notes often contain medical nuance, contradictions, or unstructured observations that require careful reading. You want the education video to be medically sound. Use n8n's HTTP Request node to call the Anthropic API:
POST https://api.anthropic.com/v1/messages
Authorization: Bearer $ANTHROPIC_API_KEY
Content-Type: application/json { "model": "claude-opus-4.6", "max_tokens": 1024, "messages": [ { "role": "user", "content": "You are a medical educator. From these clinical notes, extract 3-4 key education points a patient should understand about their condition. Format each point as a single sentence. Be specific and avoid jargon.\n\nDiagnosis: {{$json.diagnosis}}\nNotes: {{$json.consultation_notes}}\n\nOutput a JSON object with a 'points' array containing strings." } ]
}
Claude returns something like:
json
{ "points": [ "Metformin helps your body use insulin more effectively by reducing glucose production in the liver.", "Eating protein and fibre with each meal slows down how quickly sugar enters your bloodstream.", "Checking your blood sugar regularly helps you and your doctor see how well your current plan is working." ]
}
Step 3: Generate a Video Script
Now generate a conversational script for the video. Call Claude again with those education points:
POST https://api.anthropic.com/v1/messages
Authorization: Bearer $ANTHROPIC_API_KEY
Content-Type: application/json { "model": "claude-opus-4.6", "max_tokens": 2048, "messages": [ { "role": "user", "content": "Write a 90-second script for a patient education video. Address the patient by their name. Use simple, conversational language. Include these key points:\n\n{{$json.points.join('\n')}}\n\nPatient name: {{$json.patient_name}}\nDiagnosis: {{$json.diagnosis}}\n\nFormat as plain text, ready to be spoken aloud. Aim for about 200-220 words." } ]
}
Claude produces a script like: "Hi Jane, I wanted to walk you through what your new diagnosis means and how your medication and diet work together..."
Step 4: Synthesise Narration with ElevenLabs
Pass the script to ElevenLabs Turbo v2.5 for voice synthesis. ElevenLabs produces natural-sounding speech and supports professional voice clones if you want consistency across videos.
POST https://api.elevenlabs.io/v1/text-to-speech/{{voice_id}}/stream
Authorization: xi-api-key: $ELEVENLABS_API_KEY
Content-Type: application/json { "text": "{{$json.script}}", "model_id": "eleven_turbo_v2_5", "voice_settings": { "stability": 0.7, "similarity_boost": 0.75 }
}
Save the audio stream to a temporary file. ElevenLabs returns an MP3 with the patient's personalised education content narrated in a calm, professional voice.
Step 5: Generate Video with HeyGen
HeyGen's API lets you create a talking-avatar video from a script and audio. You supply the voiceover, HeyGen syncs a realistic avatar's mouth and gestures to it.
POST https://api.heygen.com/v1/video_talks/generate
Authorization: Bearer $HEYGEN_API_KEY
Content-Type: application/json { "voice": { "voice_file_url": "https://your-storage.blob.core.windows.net/audio/{{patient_id}}_narration.mp3" }, "avatar_id": "healthcare_avatar_001", "test": false
}
HeyGen returns a video ID. Poll the status endpoint every 10 seconds until the video finishes rendering (usually 2-3 minutes for a 90-second video).
GET https://api.heygen.com/v1/video_talks/{{video_id}}
Authorization: Bearer $HEYGEN_API_KEY
Once status is "completed", download the video file.
Step 6: Upload to Patient Portal
Store the finished video in your EHR's secure patient portal or cloud storage. Use your EHR's API to link the video to the patient's record and send them a notification that their education content is ready. If you use Azure, upload directly to Blob Storage and generate a shared access signature (SAS) URL that expires in 30 days:
PUT https://your-storage.blob.core.windows.net/patient-videos/{{patient_id}}_education.mp4?sv=2021-06-08&sig={{SAS_SIGNATURE}}&se={{EXPIRY}}
Content-Type: video/mp4
Your n8n workflow ends here. The patient receives an SMS or email with a link to their personalised education video, all created without a single manual step.
The Manual Alternative
If you want human approval before publishing, add a pause step. After the HeyGen video renders, have n8n send a Slack notification to your education coordinator with a preview link. They review the content for accuracy and click "Approve" to trigger the upload step. This adds a human quality gate without blocking the automation for routine cases. Alternatively, if your clinic prefers to customise scripts before video generation, store the Claude-generated script in a shared folder and configure n8n to wait for a human to review and edit it before proceeding to ElevenLabs and HeyGen. This is slower but gives clinicians control.
Pro Tips
Rate Limiting and Quotas
ElevenLabs and HeyGen both have monthly character and video limits on lower-cost plans.
If you run 15-20 education videos per day, you'll hit free tiers quickly. Budget accordingly and request higher limits from both providers if you plan to scale. Set up alerts in n8n to pause the workflow if you're approaching monthly quotas.
Error Handling for Long Workflows
With six steps chained together, one failure breaks the chain. Use n8n's error handling nodes to catch failures at each step. For example, if Claude's API times out, retry up to three times before logging the error and notifying a human. If HeyGen video rendering fails after 10 minutes of polling, mark the record as "needs manual review" in your EHR and alert your team.
Audio Quality Over Speed
ElevenLabs Turbo v2.5 is fast, but if your clinic budget allows, use their standard TTS model instead. The voice quality improvement is noticeable and patients will perceive the education content as more professional. The 30-second rendering time difference is worth it.
Reuse Education Scripts
Once Claude generates a script for a diagnosis, store it in a database. Next time a patient with the same condition arrives, use the stored script (customised with their name) instead of calling Claude again. This cuts API costs significantly if you see recurring diagnoses.
HIPAA Compliance in Transit
Freed AI is HIPAA-compliant, but make sure your n8n instance, temporary audio files, and storage buckets are also compliant. Use HTTPS for all API calls, encrypt data at rest, and delete temporary files immediately after the video is uploaded. Never log full clinical notes in n8n's execution history.
Cost Breakdown
| Tool | Plan Needed | Monthly Cost | Notes |
|---|---|---|---|
| Freed AI | Pro (HIPAA) | £200–400 | Depends on consultation volume; includes EHR integration |
| Claude Opus 4.6 | Pay-as-you-go | £15–30 | ~0.5–1 million tokens per 50 education videos |
| ElevenLabs Turbo v2.5 | Creator or Pro | £99–199 | 100,000–500,000 characters per month depending on tier |
| HeyGen | Creator or Team | £120–300 | 10–50 video minutes per month depending on tier |
| n8n | Self-hosted or Cloud Pro | £0–50 | Self-hosted on your server is free; Cloud Pro is £25/user/month |
| Storage (Azure/AWS) | Standard Blob/S3 | £5–15 | For video files; minimal if videos are deleted after 30 days |
| Total | , | £440–990 | Supports 30–50 education videos per month; scales linearly |