Back to Alchemy
Alchemy RecipeIntermediateworkflow

Healthcare clinic intake form to patient education video pipeline

Healthcare clinics face a recurring problem that wastes time and creates inconsistency: patients complete intake forms, clinic staff manually transcribe or review that data, and then someone creates separate educational materials tailored to the patient's condition. The patient sits in the waiting room while staff duplicate effort across disconnected systems. By the time the patient leaves, they've received minimal educational content, and staff have spent hours on manual data entry. This workflow is particularly painful for practices managing chronic conditions, dietary restrictions, or lifestyle modifications. A patient with hypertension might fill out a form listing their medications and dietary habits, but the clinic has no automated way to generate personalised education materials that reference that specific intake data. Instead, they print generic handouts or send standard PDFs that may not address the patient's actual situation. The solution is to connect three tools into a single pipeline: capture structured data from intake forms using Freed AI, feed that data to HeyGen to generate a personalised patient education video, and optionally use Tastebuds AI to create dietary recommendations if nutrition is relevant. When orchestrated correctly, a patient can walk out with a custom video they can watch at home, all generated automatically from their intake form answers. For more on this, see Healthcare patient education video creation from clinical.... For more on this, see Real estate listing creation and virtual tour generation. For more on this, see Automated healthcare clinic intake form to patient educat.... For more on this, see Healthcare clinic patient intake to personalised educatio.... For more on this, see Healthcare patient education video creation from clinical.... For more on this, see Automated healthcare clinic intake form to patient educat....

The Automated Workflow

The workflow consists of four main stages: data capture, enrichment, video generation, and optional nutrition recommendations. We'll build this using n8n because it offers strong native support for webhooks, conditional logic, and both Freed AI and HeyGen integrations without requiring custom code.

Stage 1: Intake Form Submission Triggers Freed AI

When a patient completes a form (whether in your existing EHR, a standalone Google Form, or a custom web form), send the submission data to n8n via a webhook. Freed AI will then process the intake data to extract structured fields: patient name, age, medical conditions, current medications, dietary restrictions, and lifestyle factors.

POST https://your-n8n-instance.com/webhook/patient-intake
Content-Type: application/json { "patient_name": "Sarah Mitchell", "age": 52, "form_data": { "chief_complaint": "High blood pressure", "current_medications": "Lisinopril 10mg daily", "dietary_habits": "High sodium, irregular meals", "activity_level": "Sedentary, desk job" }
}

Within n8n, set up a node that calls the Freed AI API to parse and standardise this intake data:

POST https://api.freed.ai/v1/extract
Authorization: Bearer YOUR_FREED_API_KEY
Content-Type: application/json { "text": "Patient Sarah Mitchell, 52 years old. Chief complaint: high blood pressure. Currently taking Lisinopril 10mg daily. Reports high sodium diet and sedentary lifestyle.", "extract_fields": [ "patient_name", "age", "diagnosis", "medications", "dietary_concerns", "activity_level" ]
}

Freed AI returns structured JSON with confidence scores, which n8n stores in a variable for the next steps.

Stage 2: Enrich Data and Generate Video Script

Once you have structured intake data, use GPT-4.1 or Claude Sonnet 4.6 (via n8n's native nodes) to generate a personalised educational script. This script should reference the patient's specific condition, current treatment, and lifestyle factors. The prompt is crucial; it should instruct the model to write in conversational, accessible language and keep the video to 90-120 seconds.

POST https://api.openai.com/v1/chat/completions
Authorization: Bearer YOUR_OPENAI_API_KEY
Content-Type: application/json { "model": "gpt-4.1", "messages": [ { "role": "system", "content": "You are a friendly clinical educator. Generate a brief, personalised patient education script based on their intake data. Keep it under 120 seconds of narration. Use the patient's name once. Reference their specific condition and current medications. Offer one or two actionable tips they can start today." }, { "role": "user", "content": "Patient: Sarah Mitchell, 52. Diagnosis: Stage 1 hypertension. Medications: Lisinopril 10mg daily. Concerns: High sodium diet, sedentary lifestyle. Generate an education script about managing blood pressure at home." } ], "temperature": 0.7, "max_tokens": 500
}

The API returns a script. Store this in an n8n variable for the next step.

Stage 3: Generate Personalised Video with HeyGen

HeyGen creates a talking-head video with an AI avatar narrating the script you just generated. This is where the workflow becomes truly impressive to patients. Instead of handing them a PDF, they receive a custom video where an avatar speaks directly to them about their condition.

POST https://api.heygen.com/v1/video_requests
Authorization: Bearer YOUR_HEYGEN_API_KEY
Content-Type: application/json { "test": false, "caption": false, "title": "Patient Education for Sarah Mitchell", "script": { "type": "text", "input": "Hi Sarah, I'm here to talk about managing your blood pressure. You're now on Lisinopril, which is a great first step. One thing I want to emphasize is reducing sodium in your diet. Try cutting back on processed foods and using herbs instead of salt. Also, even a 10-minute walk after meals can help lower your blood pressure. Let's work together to keep you healthy." }, "avatar": { "avatar_id": "wayne_20191211", "voice": { "voice_id": "en-US-ArthurNeural", "rate": 1.0 } }, "dimension": { "width": 1920, "height": 1080 }
}

HeyGen processes this asynchronously. Your n8n workflow should poll the status endpoint until the video is ready, then download the video file to your storage (Google Drive, AWS S3, or your clinic's file system). Stage 4 (Optional): Generate Personalised Nutrition Recommendations If the patient's intake data flagged dietary concerns, trigger a call to Tastebuds AI to generate a small set of recipes that match their restrictions and health goals. This is optional but adds significant value for patients managing hypertension or diabetes.

POST https://api.tastebuds.ai/v1/recipes
Authorization: Bearer YOUR_TASTEBUDS_API_KEY
Content-Type: application/json { "dietary_restrictions": [ "low sodium", "heart-healthy" ], "servings": 2, "cuisine_preference": "any", "max_prep_time": 30, "count": 3
}

Store the resulting recipes as a PDF or HTML document, and include them in the patient communication package alongside the video.

Delivery and Storage

Configure n8n to email the video, recipes, and a summary document to the patient within minutes of their intake submission. Store copies in your EHR (if API-compatible) or a secure cloud folder. Add a unique patient ID to the filename so videos are never mixed up.

POST https://api.sendgrid.com/v3/mail/send
Authorization: Bearer YOUR_SENDGRID_API_KEY
Content-Type: application/json { "personalizations": [ { "to": [ { "email": "sarah.mitchell@example.com" } ] } ], "from": { "email": "clinic@yourhealthcare.com", "name": "Your Clinic" }, "subject": "Your Personalised Health Education Video", "content": [ { "type": "text/html", "value": "Dear Sarah, attached is your personalised education video and nutrition guide. Watch the video at your convenience and start with one of the recipes this week. Questions? Reply to this email." } ], "attachments": [ { "filename": "sarah_mitchell_education_video.mp4", "type": "video/mp4", "content": "base64-encoded-video-data" } ]
}

The Manual Alternative

If your clinic prefers more control or wants to test individual components before full automation, you can run this workflow semi-manually: 1. Staff exports intake forms to a spreadsheet each day.

  1. A clinician reviews the data and manually triggers video generation by pasting the patient name and key facts into a HeyGen template.

  2. A dietitian or health coach generates nutrition recommendations separately using Tastebuds AI and adds them to the patient file.

  3. Staff email the video and materials to the patient. This approach takes longer (roughly 15-20 minutes per patient) but eliminates the risk of misconfigured automation and lets you refine your messaging before scaling up.

Pro Tips

Error Handling and Rate Limiting

Freed AI, HeyGen, and Tastebuds AI all enforce rate limits.

Set n8n's retry logic to wait 5-10 seconds between retries, and use exponential backoff to avoid overwhelming the APIs. For Freed AI in particular, catch cases where the model cannot confidently extract certain fields; flag these for manual review rather than proceeding with incomplete data.

Test with Real Patient Data (Anonymised)

Before deploying to production, run the workflow with 5-10 real intake forms and review the generated videos and scripts. Audio quality, avatar personality, and script tone matter to patients. Adjust your system prompts accordingly.

Cache Generated Scripts

If multiple patients have the same primary diagnosis (e.g. hypertension), cache the generated script from GPT-4.1 and reuse it rather than regenerating it for each patient. This cuts API costs by roughly 40% for high-volume conditions.

Monitor HeyGen Video Quality

HeyGen occasionally produces videos with audio sync issues or avatar glitches. Set up a simple check: before sending to the patient, have a human or automated system verify the video duration matches the expected script length. If it differs by more than 5 seconds, flag it for manual review.

Manage Storage and HIPAA Compliance

Videos contain patient names and health information. Store them in HIPAA-compliant storage (encrypted AWS S3 with versioning and access logs, or a HIPAA-certified cloud platform). Set up automatic deletion of videos after 90 days unless the patient explicitly requests to keep them longer.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Freed AIPro (50,000 extractions/month)£150Covers typical clinic volume of 1,500 patients/month
HeyGenCreator (150 minutes of video/month)£79Generates roughly 60-75 patient videos at 2-3 minutes each
Tastebuds AIStandard (500 recipe calls/month)£49Optional; includes USDA nutrition data
n8nSelf-hosted or Cloud (Professional)£0–£192Self-hosted is free; cloud Professional tier covers 10,000 executions/month
SendGrid (email delivery)Essentials (5,000 emails/month)£20Sends videos to patients and backup records to clinic
Cloud storage (S3 or equivalent)Pay as you go£10–£30Depends on video duration and archival period
Total£308–£520Covers 1,500–2,000 patient education workflows per month