# Upload Video to YouTube

**Action ID:** `youtube_upload_video`

## Description

Upload a video to YouTube using the YouTube Data API. This node allows you to programmatically upload videos with custom metadata including title, description, category, keywords, and privacy settings.

## Connection

| Name               | Description                                            | Required | Category |
| ------------------ | ------------------------------------------------------ | -------- | -------- |
| YouTube Connection | The YouTube connection to use to call the YouTube API. | True     | youtube  |

## Input Parameters

| Name            | Type     | Required | Default             | Description                                                                                                                |
| --------------- | -------- | :------: | ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| file\_path      | string   |     ✓    | -                   | Path to the video file to upload                                                                                           |
| title           | string   |     -    | Test Title          | Title of the video                                                                                                         |
| description     | string   |     -    | Default Description | Description of the video                                                                                                   |
| category        | string   |     -    | 22                  | Numeric video category ID. See [YouTube documentation](https://developers.google.com/youtube/v3/docs/videoCategories/list) |
| keywords        | string   |     -    | ""                  | Video keywords, comma separated                                                                                            |
| privacy\_status | dropdown |     -    | private             | Video privacy status. Options: public, private, unlisted                                                                   |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Upload video to YouTube node input.",
  "properties": {
    "file_path": {
      "description": "Path to the video file to upload",
      "title": "Video File Path",
      "type": "string"
    },
    "title": {
      "default": "Test Title",
      "description": "Title of the video",
      "title": "Video Title",
      "type": "string"
    },
    "description": {
      "default": "Default Description",
      "description": "Description of the video",
      "title": "Video Description",
      "type": "string"
    },
    "category": {
      "default": "22",
      "description": "Numeric video category ID. See https://developers.google.com/youtube/v3/docs/videoCategories/list",
      "title": "Category ID",
      "type": "string"
    },
    "keywords": {
      "default": "",
      "description": "Video keywords, comma separated",
      "title": "Keywords",
      "type": "string"
    },
    "privacy_status": {
      "default": "private",
      "description": "Video privacy status",
      "enum": [
        "public",
        "private",
        "unlisted"
      ],
      "title": "Privacy Status",
      "type": "string"
    }
  },
  "required": [
    "file_path"
  ],
  "title": "UploadVideoToYoutubeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name       | Type   | Description               |
| ---------- | ------ | ------------------------- |
| video\_id  | string | ID of the uploaded video  |
| video\_url | string | URL of the uploaded video |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "Upload video to YouTube node output.",
  "properties": {
    "video_id": {
      "description": "ID of the uploaded video",
      "title": "Video ID",
      "type": "string"
    },
    "video_url": {
      "description": "URL of the uploaded video",
      "title": "Video URL",
      "type": "string"
    }
  },
  "required": [
    "video_id",
    "video_url"
  ],
  "title": "UploadVideoToYoutubeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node authenticates with YouTube using your configured connection credentials and uploads the video file from the specified path. It reads the video file, packages it with the provided metadata (title, description, category, keywords, and privacy status), and sends it to the YouTube Data API. Once the upload completes, YouTube processes the video and returns a unique video ID and URL that can be used to access and manage the video.

## Usage Examples

### Example 1: Upload Private Video for Review

**Input:**

```
file_path: "/videos/product-demo.mp4"
title: "Product Demo - Q1 2024"
description: "Demonstration of new features released in Q1 2024"
category: "28"
keywords: "product, demo, tutorial, features"
privacy_status: "private"
```

**Output:**

```
video_id: "dQw4w9WgXcQ"
video_url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
```

### Example 2: Publish Public Tutorial Video

**Input:**

```
file_path: "/content/how-to-guide.mp4"
title: "Complete Beginner's Guide to AgenticFlow"
description: "Learn how to build automated workflows with AgenticFlow in this comprehensive tutorial"
category: "27"
keywords: "tutorial, guide, automation, workflow, beginner"
privacy_status: "public"
```

**Output:**

```
video_id: "a1b2c3d4e5f"
video_url: "https://www.youtube.com/watch?v=a1b2c3d4e5f"
```

### Example 3: Upload Unlisted Marketing Video

**Input:**

```
file_path: "/marketing/campaign-video.mp4"
title: "Spring Sale 2024 - Special Offer"
description: "Exclusive spring sale announcement for our subscribers"
category: "22"
keywords: "sale, promotion, spring, special offer"
privacy_status: "unlisted"
```

**Output:**

```
video_id: "xyz789abc123"
video_url: "https://www.youtube.com/watch?v=xyz789abc123"
```

## Common Use Cases

* **Automated Content Publishing**: Automatically upload videos generated by your workflow to YouTube
* **Course Content Delivery**: Upload educational videos and tutorials as part of an online course workflow
* **Marketing Campaign Distribution**: Publish marketing videos and promotional content to YouTube channels
* **Event Recordings**: Upload recorded webinars, conferences, or live events automatically
* **Product Demonstrations**: Share product demos and feature showcases with customers
* **Batch Video Uploads**: Upload multiple videos in sequence as part of a content calendar workflow
* **Video Archive Management**: Automatically upload and organize archived video content

## Error Handling

| Error Type            | Cause                                                     | Solution                                                                   |
| --------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------- |
| File Not Found        | Video file path doesn't exist or is inaccessible          | Verify the file path is correct and the file exists at that location       |
| Authentication Failed | YouTube connection credentials are invalid or expired     | Reconfigure your YouTube connection with valid OAuth credentials           |
| Invalid Video Format  | Video file format is not supported by YouTube             | Convert the video to a YouTube-supported format (MP4, AVI, MOV, WMV, etc.) |
| Quota Exceeded        | Daily upload quota limit has been reached                 | Wait until the quota resets or request a quota increase from Google        |
| File Too Large        | Video file size exceeds YouTube's maximum limit           | Compress the video or split it into smaller segments                       |
| Invalid Category      | Category ID doesn't exist or is not available             | Use a valid category ID from the YouTube category list                     |
| Upload Timeout        | Upload took too long due to slow connection or large file | Retry the upload or check your network connection                          |

## Notes

* **Authentication Required**: You must configure a YouTube connection with OAuth 2.0 credentials before using this node.
* **File Path**: The file\_path must be accessible from the workflow execution environment—use absolute paths or ensure relative paths are correct.
* **Category IDs**: Common categories include 22 (People & Blogs), 27 (Education), 28 (Science & Technology). See YouTube documentation for the full list.
* **Privacy Settings**: Videos uploaded as "private" are only visible to you and users you specifically grant access to. "Unlisted" videos can be viewed by anyone with the link.
* **Keywords**: Use relevant, comma-separated keywords to improve video discoverability and SEO.
* **Upload Limits**: YouTube has daily upload quotas and file size limits (typically 128GB or 12 hours of video).
* **Processing Time**: After upload, YouTube processes the video before it's fully available. Higher resolutions take longer to process.
* **Monetization**: This node uploads videos but doesn't configure monetization settings—those must be set separately in YouTube Studio.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/youtube_upload_video.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
