{
  "name": "bundle.social: Google Drive to YouTube",
  "nodes": [
    {
      "parameters": {
        "content": "## Google Drive to YouTube\n\nEvery new video in a Google Drive folder is uploaded to bundle.social and published on YouTube right away. Other file types are skipped.\n\n**Setup**\n1. Install the community node **n8n-nodes-bundlesocial** (Settings > Community Nodes) on self-hosted n8n.\n2. Add a **bundle.social API** credential with a key from bundle.social > Organization > API Keys, and a Google Drive credential.\n3. In **New file in Drive folder**, pick the folder to watch.\n4. In **Create post**, pick the team that has the YouTube account connected.\n   Privacy is PUBLIC; switch it to PRIVATE or UNLISTED in **YouTube Settings** if you review videos first.\n5. Activate the workflow. The caption is the file name without its extension; edit it in **Create post**.",
        "height": 360,
        "width": 440,
        "color": 4
      },
      "id": "fc2ef4ae-044a-5f7c-9919-43e1be5aa99e",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -560,
        -200
      ]
    },
    {
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "id": "da1ea907-98c6-5a90-8f03-8d08ca02e8ae",
      "name": "New file in Drive folder",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bf11ed82-a343-5748-afad-f58813b2e30a",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "video/"
            }
          ]
        }
      },
      "id": "2f410111-47db-5846-9f1a-718a9981c585",
      "name": "Only videos",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {}
      },
      "id": "31e4f827-b9c5-51b5-9903-eb4314fd4296",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "resource": "upload",
        "operation": "uploadLargeFile",
        "binaryPropertyName": "data",
        "additionalFields": {}
      },
      "id": "876933e6-5a2e-5c07-ad60-ef31368ec1c9",
      "name": "Upload to bundle.social",
      "type": "n8n-nodes-bundlesocial.bundleSocial",
      "typeVersion": 1,
      "position": [
        720,
        0
      ]
    },
    {
      "parameters": {
        "resource": "post",
        "operation": "create",
        "teamId": "",
        "title": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '') }}",
        "postDate": "={{ $now.toISO() }}",
        "status": "SCHEDULED",
        "socialAccountTypes": [
          "YOUTUBE"
        ],
        "dataYoutube": {
          "type": "VIDEO",
          "text": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '').slice(0, 100) }}",
          "description": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '') }}",
          "privacy": "PUBLIC",
          "madeForKids": false,
          "uploadIds": "={{ $json.id }}"
        }
      },
      "id": "1e0b80dd-d613-5113-88d5-dfe697e702cf",
      "name": "Create post",
      "type": "n8n-nodes-bundlesocial.bundleSocial",
      "typeVersion": 1,
      "position": [
        960,
        0
      ]
    }
  ],
  "connections": {
    "New file in Drive folder": {
      "main": [
        [
          {
            "node": "Only videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only videos": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Upload to bundle.social",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to bundle.social": {
      "main": [
        [
          {
            "node": "Create post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}