> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/darkzOGx/youtube-automation-agent/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating Your First Video

> Complete walkthrough for generating and publishing your first automated YouTube video

## Overview

This guide walks you through the entire process of creating your first video with the YouTube Automation Agent, from initial setup to successful publishing.

<Note>
  Before starting, ensure you've completed the [Quick Start](/quickstart) guide and have all credentials configured.
</Note>

## Pre-flight Checklist

Before generating your first video, verify your system is ready:

<Steps>
  <Step title="Check System Health">
    Verify all agents are initialized:

    ```bash theme={null}
    curl http://localhost:3456/health
    ```

    Expected response:

    ```json theme={null}
    {
      "status": "healthy",
      "initialized": true,
      "agents": [
        "strategy",
        "scriptWriter",
        "thumbnailDesigner",
        "seoOptimizer",
        "production",
        "publishing",
        "analytics"
      ],
      "timestamp": "2024-01-15T10:30:00.000Z"
    }
    ```
  </Step>

  <Step title="Verify Credentials">
    Ensure all required credentials are configured:

    * YouTube Data API credentials
    * OpenAI API key
    * DALL-E API access (for thumbnails)
    * OAuth tokens for YouTube upload
  </Step>

  <Step title="Check Database Connection">
    The system should show "database: true" in health checks. If not, reinitialize with `npm run db:init`.
  </Step>
</Steps>

## Generation Methods

### Method 1: Automatic Generation (Recommended)

The easiest way to create your first video is to let the automation schedule handle it:

<Steps>
  <Step title="Wait for Scheduled Generation">
    By default, content is automatically generated daily at **6:00 AM**. Simply keep the agent running:

    ```bash theme={null}
    npm start
    ```

    You'll see:

    ```
    🤖 Automation is active. Content will be generated and posted daily.
    ```
  </Step>

  <Step title="Monitor Progress">
    Watch the console for generation progress:

    ```
    [ContentStrategy] Starting content generation pipeline...
    [ContentStrategy] Strategy generated: The Art of Digital Storytelling
    [ScriptWriter] Script generated: How Stories Shape Our Digital World
    [ThumbnailDesigner] Thumbnail generated
    [SEOOptimizer] SEO optimization complete
    [ProductionManagement] Production processing complete
    [Database] Content saved with ID: abc123xyz
    ```
  </Step>

  <Step title="Review Generated Content">
    Check the dashboard at `http://localhost:3456` to see your content in the schedule.
  </Step>
</Steps>

### Method 2: Manual Generation via API

For immediate content generation, use the manual trigger:

```bash theme={null}
curl -X POST http://localhost:3456/generate \
  -H "Content-Type: application/json" \
  -d '{
    "topic": null,
    "style": "story",
    "length": "medium"
  }'
```

<Tip>
  Leave `topic` as `null` to let the Content Strategy Agent choose the best topic based on trending content and your channel's performance.
</Tip>

**Response:**

```json theme={null}
{
  "success": true,
  "result": {
    "contentId": "abc123xyz",
    "title": "How Stories Shape Our Digital World",
    "scheduledFor": "2024-01-16T14:00:00.000Z"
  }
}
```

### Method 3: Manual Generation via Dashboard

Use the web interface for a visual approach:

<Steps>
  <Step title="Open Dashboard">
    Navigate to `http://localhost:3456` in your browser.
  </Step>

  <Step title="Click Generate Button">
    Click the **🎬 Generate Content Now** button in the status bar.
  </Step>

  <Step title="Confirm Generation">
    Confirm the prompt: "Generate content now? This will create a new video for your channel."
  </Step>

  <Step title="Wait for Completion">
    The system will process through all 6 agents:

    1. Content Strategy Agent
    2. Script Writer Agent
    3. Thumbnail Designer Agent
    4. SEO Optimizer Agent
    5. Production Management Agent
    6. Publishing Scheduling Agent

    This typically takes 2-5 minutes.
  </Step>
</Steps>

## Content Generation Pipeline

Understand what happens during generation:

### Stage 1: Content Strategy

The Content Strategy Agent:

* Analyzes trending topics in your niche
* Reviews past video performance
* Considers audience engagement patterns
* Selects optimal content topic and angle

### Stage 2: Script Writing

The Script Writer Agent:

* Generates engaging narrative structure
* Creates hook, body, and call-to-action
* Optimizes for viewer retention
* Formats for video production

### Stage 3: Thumbnail Design

The Thumbnail Designer Agent:

* Creates eye-catching visual design
* Uses AI-generated imagery (DALL-E)
* Adds text overlays and branding
* Optimizes for click-through rate

### Stage 4: SEO Optimization

The SEO Optimizer Agent:

* Generates title variations
* Creates compelling description
* Selects targeted tags and keywords
* Optimizes for YouTube algorithm

### Stage 5: Production Processing

The Production Management Agent:

* Compiles all assets
* Validates content quality
* Prepares metadata
* Creates video file structure

### Stage 6: Publishing Schedule

The Publishing Scheduling Agent:

* Determines optimal publish time (default: 2:00 PM)
* Queues content for automated upload
* Sets up monitoring for post-publish analytics

## Customizing Your First Video

You can customize generation with specific parameters:

<CodeGroup>
  ```bash Topic-Specific theme={null}
  curl -X POST http://localhost:3456/generate \
    -H "Content-Type: application/json" \
    -d '{
      "topic": "The Power of Visual Storytelling",
      "style": "story",
      "length": "medium"
    }'
  ```

  ```bash Tutorial Style theme={null}
  curl -X POST http://localhost:3456/generate \
    -H "Content-Type: application/json" \
    -d '{
      "topic": "How to Create Engaging Animations",
      "style": "tutorial",
      "length": "long"
    }'
  ```

  ```bash Quick Content theme={null}
  curl -X POST http://localhost:3456/generate \
    -H "Content-Type: application/json" \
    -d '{
      "topic": null,
      "style": "explainer",
      "length": "short"
    }'
  ```
</CodeGroup>

### Available Parameters

| Parameter | Type        | Options                          | Description                   |
| --------- | ----------- | -------------------------------- | ----------------------------- |
| `topic`   | string/null | Any topic or `null`              | Specific topic or auto-select |
| `style`   | string      | `story`, `tutorial`, `explainer` | Content presentation style    |
| `length`  | string      | `short`, `medium`, `long`        | Target video length           |

## Publishing Your First Video

Once content is generated, it's automatically scheduled for publishing:

### Automatic Publishing

The system checks the publish queue every **15 minutes** and automatically uploads videos when their scheduled time arrives.

```bash theme={null}
# View upcoming schedule
curl http://localhost:3456/schedule
```

**Response:**

```json theme={null}
[
  {
    "id": "abc123xyz",
    "title": "How Stories Shape Our Digital World",
    "publishTime": "2024-01-16T14:00:00.000Z",
    "status": "scheduled"
  }
]
```

### Manual Publishing

To publish immediately, use the manual publish endpoint:

```bash theme={null}
curl -X POST http://localhost:3456/publish/abc123xyz
```

<Note>
  Replace `abc123xyz` with your actual content ID from the generation response.
</Note>

**Response:**

```json theme={null}
{
  "success": true,
  "result": {
    "videoId": "dQw4w9WgXcQ",
    "status": "published",
    "url": "https://youtube.com/watch?v=dQw4w9WgXcQ"
  }
}
```

## Monitoring Your Video

After publishing, the system automatically tracks performance:

### Analytics Collection

Analytics are collected daily at **9:00 AM** for all videos published in the last 7 days.

```bash theme={null}
# View analytics
curl http://localhost:3456/analytics
```

### Dashboard Monitoring

The dashboard at `http://localhost:3456` provides real-time insights:

* View count and engagement
* Performance score
* Audience retention
* Click-through rate
* Top performing content

## Troubleshooting

### Generation Fails

<Tip>
  Check the console logs for specific error messages. Most failures are due to API credentials or rate limits.
</Tip>

**Common issues:**

* **"Credentials invalid"**: Run `npm run credentials:setup`
* **"Rate limit exceeded"**: Wait for API quota to reset
* **"Database error"**: Reinitialize with `npm run db:init`

### Content Not Publishing

If content remains stuck in "scheduled" status:

1. Check the publish queue is processing:
   ```bash theme={null}
   curl http://localhost:3456/health
   ```

2. Verify OAuth tokens are valid:
   ```bash theme={null}
   npm run credentials:validate
   ```

3. Manually trigger publishing:
   ```bash theme={null}
   curl -X POST http://localhost:3456/publish/YOUR_CONTENT_ID
   ```

### Low Quality Output

If your first video doesn't meet expectations:

* Let the system run for a few cycles - it improves with analytics data
* Adjust content strategy settings in the dashboard
* Provide specific topics instead of auto-selection
* Review and customize the SEO optimization parameters

## Next Steps

Congratulations on creating your first video! Continue with:

<CardGroup cols={2}>
  <Card title="Automation Schedule" icon="calendar" href="/guides/automation-schedule">
    Configure automated content generation and posting frequency
  </Card>

  <Card title="Manual Operations" icon="hand" href="/guides/manual-operations">
    Learn all manual control endpoints and override options
  </Card>

  <Card title="Dashboard Guide" icon="chart-line" href="/guides/dashboard">
    Master the web dashboard for monitoring and control
  </Card>

  <Card title="Agent Configuration" icon="robot" href="/configuration/ai-providers">
    Customize individual agent behaviors and parameters
  </Card>
</CardGroup>
