> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Training & Onboarding Videos

> Produce corporate training and employee onboarding videos at scale via the HeyGen API. Update scripts and regenerate in minutes when policy or process changes.

## The Problem

Corporate training content is expensive to produce, goes stale fast, and doesn't scale across languages. A single compliance training video can cost $5,000–$15,000 to produce professionally — and needs to be re-recorded every time a policy changes.

## How It Works

```
Training docs/policies → LLM structures into video modules → Video Agent renders → Translate for global teams
```

Generate training videos from your existing materials. When the source document updates, regenerate the video. Need it in 10 languages? Use Video Translation.

## Build It

<Steps>
  <Step title="Structure your training material">
    Break content into modules. Each module becomes a separate video — this keeps videos short (2–5 minutes) and makes updates surgical.

    ```python theme={null}
    modules = [
        {
            "title": "Data Privacy Basics",
            "source": "policies/data-privacy.pdf",
            "duration": "3 minutes",
            "style": "professional, clear, reassuring",
        },
        {
            "title": "Handling Customer Data",
            "source": "policies/data-handling.md",
            "duration": "4 minutes",
            "style": "professional, specific, example-driven",
        },
        {
            "title": "Reporting a Breach",
            "source": "policies/breach-response.md",
            "duration": "2 minutes",
            "style": "urgent but calm, step-by-step",
        },
    ]
    ```
  </Step>

  <Step title="Generate video prompts with an LLM">
    Use an LLM to convert each training document into a structured video prompt. The LLM acts as an instructional designer.

    ```python theme={null}
    import anthropic

    client = anthropic.Anthropic()

    def generate_training_prompt(module, content):
        message = client.messages.create(
            model="claude-sonnet-4-20250514",
            max_tokens=1500,
            messages=[{
                "role": "user",
                "content": f"""You are an instructional designer creating a training
    video from a policy document. Convert this into a HeyGen Video Agent prompt.

    Structure the video as:
    1. Introduction (10s) — What this training covers and why it matters
    2. Key concepts (60-70% of duration) — Break into 2-4 clear sections
       with specific examples and scenarios employees will recognize
    3. Do's and Don'ts (15s) — Quick visual checklist
    4. Summary + quiz teaser (10s) — Recap key points, prompt to take the quiz

    Requirements:
    - Tone: {module['style']}
    - Duration: {module['duration']}
    - Use text overlays for key terms and definitions
    - Include scenario-based examples ("Imagine you receive an email from...")
    - Make it engaging — this isn't a lecture, it's a conversation

    Training document:
    {content}

    Output ONLY the Video Agent prompt."""
            }],
        )
        return message.content[0].text

    # Generate prompt for each module
    for module in modules:
        with open(module["source"]) as f:
            content = f.read()
        module["video_prompt"] = generate_training_prompt(module, content)
    ```
  </Step>

  <Step title="Generate videos">
    Submit each module to Video Agent. Space them out for rate limits.

    ```python theme={null}
    import requests
    import time

    HEYGEN_API_KEY = "your-api-key"

    for module in modules:
        resp = requests.post(
            "https://api.heygen.com/v3/video-agents",
            headers={
                "X-Api-Key": HEYGEN_API_KEY,
                "Content-Type": "application/json",
            },
            json={
                "prompt": module["video_prompt"],
                # Optional: attach policy document for visual context
                # "files": [{"type": "url", "url": "https://..."}]
            },
        )
        module["video_id"] = resp.json()["data"]["video_id"]
        print(f"Submitted: {module['title']} → {module['video_id']}")
        time.sleep(5)
    ```

    Then poll for completion — see [Video Agent docs](/docs/video-agent) for the polling pattern.
  </Step>

  <Step title="Translate for global teams">
    Once your English videos are ready, translate them for every region in one batch.

    ```python theme={null}
    languages = ["es", "fr", "de", "ja", "zh", "pt", "ko"]

    for module in modules:
        resp = requests.post(
            "https://api.heygen.com/v2/video_translate",
            headers={
                "X-Api-Key": HEYGEN_API_KEY,
                "Content-Type": "application/json",
            },
            json={
                "video_url": module["video_url"],
                "output_languages": languages,
            },
        )
        module["translations"] = resp.json()
        print(f"Translating {module['title']} into {len(languages)} languages")
    ```

    See [Video Translation docs](/docs/video-translate) for speed vs precision mode and all supported languages.
  </Step>
</Steps>

## Training Categories

This workflow applies to any training content:

| Category                          | Source material                       | Key considerations                                   |
| --------------------------------- | ------------------------------------- | ---------------------------------------------------- |
| **Compliance** (HIPAA, GDPR, SOX) | Regulatory docs, policies             | Must be accurate, auditable, up-to-date              |
| **Onboarding**                    | Employee handbook, culture docs       | Warm and welcoming tone, company-specific            |
| **Software training**             | Help docs, screenshots                | Attach screenshots as file inputs for visual context |
| **Safety**                        | Safety procedures, SOPs               | Clear, step-by-step, scenario-based                  |
| **Sales enablement**              | Product knowledge, objection handling | Conversational, example-heavy                        |

## Keeping Videos in Sync

The biggest advantage of generated training videos: **when the policy changes, regenerate the video.**

```
Policy doc updated → Detect change (git diff, CMS webhook, manual trigger)
                   → Re-run the same pipeline
                   → New video replaces the old one
                   → Re-translate if needed
```

No re-recording, no scheduling a film crew, no editing. Just re-run the pipeline.

## Variations

* **Interactive follow-up:** After the pre-rendered training video, launch a [Live Avatar AI Tutor](/cookbook/live-avatar/ai-tutor) for Q\&A and knowledge checks
* **Manager versions:** Generate a shorter executive summary version alongside the full training
* **Assessment-ready:** End each video with key questions that feed into your LMS quiz system

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Multilingual Content" icon="globe" href="/cookbook/video-agent/multilingual-content">
    Deep dive into translating videos across languages.
  </Card>

  <Card title="AI Tutor" icon="graduation-cap" href="/cookbook/live-avatar/ai-tutor">
    Add interactive Q\&A after training with a Live Avatar tutor.
  </Card>
</CardGroup>
