{
  "name": "Sheet \u279c YouTube Auto\u2011Uploader",
  "nodes": [
    {
      "id": "1",
      "name": "Cron Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        200,
        200
      ],
      "parameters": {
        "cronExpression": "0 * * * *"
      }
    },
    {
      "id": "2",
      "name": "Read Rows",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        400,
        200
      ],
      "parameters": {
        "operation": "read",
        "sheetId": "SPREADSHEET_ID",
        "range": "Sheet1!A:F",
        "options": {
          "returnAll": true,
          "includeRowNumber": true
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "3",
      "name": "SplitInBatches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        620,
        200
      ],
      "parameters": {
        "batchSize": 1
      }
    },
    {
      "id": "4",
      "name": "Fetch Video",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        840,
        200
      ],
      "parameters": {
        "url": "={{$json[\"videoURL\"]}}",
        "responseFormat": "file",
        "binaryPropertyName": "data"
      }
    },
    {
      "id": "5",
      "name": "Set Meta",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1060,
        200
      ],
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "title",
              "value": "={{$json[\"title\"]}}"
            },
            {
              "name": "description",
              "value": "={{$json[\"description\"]}}"
            },
            {
              "name": "tags",
              "value": "={{$json[\"tags\"]}}"
            }
          ],
          "number": [
            {
              "name": "rowNumber",
              "value": "={{$json[\"rowNumber\"]}}"
            }
          ]
        }
      }
    },
    {
      "id": "6",
      "name": "YouTube Upload",
      "type": "n8n-nodes-base.youtube",
      "typeVersion": 1,
      "position": [
        1280,
        200
      ],
      "parameters": {
        "operation": "upload",
        "binaryProperty": "data",
        "title": "={{$json[\"title\"]}}",
        "description": "={{$json[\"description\"]}}",
        "tags": "={{$json[\"tags\"]}}",
        "privacyStatus": "public"
      },
      "credentials": {
        "youtubeOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "7",
      "name": "Write Back",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1500,
        200
      ],
      "parameters": {
        "operation": "update",
        "sheetId": "SPREADSHEET_ID",
        "range": "Sheet1!A:F",
        "key": "rowNumber",
        "dataStartRow": 2,
        "updateData": [
          {
            "key": "rowNumber",
            "value": "={{$json[\"rowNumber\"]}}"
          },
          {
            "key": "status",
            "value": "uploaded"
          },
          {
            "key": "yt_id",
            "value": "={{$node[\"YouTube Upload\"].json[\"id\"]}}"
          },
          {
            "key": "publish_ts",
            "value": "={{$now}}"
          }
        ]
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Cron Trigger": {
      "main": [
        [
          {
            "node": "Read Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Rows": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitInBatches": {
      "main": [
        [
          {
            "node": "Fetch Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Video": {
      "main": [
        [
          {
            "node": "Set Meta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Meta": {
      "main": [
        [
          {
            "node": "YouTube Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube Upload": {
      "main": [
        [
          {
            "node": "Write Back",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionMode": "regular"
  },
  "version": 1
}