{
  "name": "Automatically create and upload YouTube videos with quotes in Thai using FFmpeg",
  "nodes": [
    {
      "id": "99e8f5d2-247a-44c7-85db-4bdd63c2a4f6",
      "name": "Start AutoClip Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        40,
        0
      ]
    },
    {
      "id": "221b0fa1-7e71-43e1-88a6-7070c6c10ed8",
      "name": "Retrieve Video Background Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        500,
        180
      ]
    },
    {
      "id": "120db4aa-5a1a-4685-9d1d-6d7814b20458",
      "name": "Retrieve Quote Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        500,
        0
      ]
    },
    {
      "id": "17e6585a-0e48-40e7-86ec-4fb53f45bd07",
      "name": "List Video Background Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        260,
        180
      ]
    },
    {
      "id": "34d51d42-2562-4437-8cbc-e0158badb134",
      "name": "Configure Music Background Folder ID",
      "type": "n8n-nodes-base.set",
      "position": [
        40,
        360
      ]
    },
    {
      "id": "0d819b1f-923d-4500-858a-166d65864872",
      "name": "List Music Background Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        260,
        360
      ]
    },
    {
      "id": "3041385c-52d9-4d95-a454-de2064164717",
      "name": "Retrieve Music Background Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        500,
        360
      ]
    },
    {
      "id": "ab86cac3-e44e-4e87-a467-a1c26e1f9752",
      "name": "Merge File Selection Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        740,
        200
      ]
    },
    {
      "id": "28c79ad7-cb34-424a-97ed-fcec5471e179",
      "name": "Select Random Video, Music & Quote",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        200
      ]
    },
    {
      "id": "bd3fa420-555d-46a2-b48c-15a916f62b44",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        -120
      ],
      "parameters": {
        "width": 1100,
        "height": 660,
        "content": "## Data Preparation & File Selection\nRetrieve and merge source data for quotes, video backgrounds, and music from Google Sheets and Google Drive; then randomly select one quote, one background video, "
      }
    },
    {
      "id": "7da639cb-6576-4ab5-891a-308ce35aecaf",
      "name": "Download Selected Video Background",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1180,
        0
      ]
    },
    {
      "id": "5ee8befc-979d-4a47-8eba-b31d6de8ea1f",
      "name": "Download Selected Music Background",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1180,
        340
      ]
    },
    {
      "id": "fd8fd1f8-64a6-4bf0-8586-8f5be506c8a1",
      "name": "Save Video Background Locally",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1420,
        0
      ]
    },
    {
      "id": "9a8e1891-16c2-490c-ae91-4773f90e67d3",
      "name": "Save Music Background Locally",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1420,
        340
      ]
    },
    {
      "id": "9fdca64e-79d7-4a58-91dc-4aa9f9b3c4cc",
      "name": "Prepare Overlay Text (Quote & Author)",
      "type": "n8n-nodes-base.code",
      "position": [
        1620,
        20
      ]
    },
    {
      "id": "082cf794-89a9-42cc-b9ee-96792a17893f",
      "name": "Generate Final Video Clip",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        1640,
        340
      ]
    },
    {
      "id": "460d3ddc-b24b-4714-8e00-023294da8375",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -120
      ],
      "parameters": {
        "width": 700,
        "height": 660,
        "content": "## File Download & Video Processing\nDownload the selected files, write them to disk, prepare overlay text (quote and author), and generate the final video clip using FFmpeg."
      }
    },
    {
      "id": "b148528f-7d45-4a59-9b29-52c7229f05e8",
      "name": "Initiate YouTube Resumable Upload",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1860,
        20
      ]
    },
    {
      "id": "e8a97b56-be01-497b-bc91-ec84bc59d039",
      "name": "Read output file",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        2060,
        20
      ]
    },
    {
      "id": "7965943e-e5c9-4c97-afca-18b3fc5881cd",
      "name": "Upload Video to YouTube",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2260,
        20
      ]
    },
    {
      "id": "040f9064-9d7f-4106-9f1c-55222d6bf4d4",
      "name": "Update Quote Upload Status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1860,
        340
      ]
    },
    {
      "id": "526ffabc-3f12-4619-abe3-01d729f96db6",
      "name": "Mark Background as Used",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2240,
        340
      ]
    },
    {
      "id": "5c833f0d-5c4b-489a-a53b-234b38433a2a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        -120
      ],
      "parameters": {
        "width": 620,
        "height": 660,
        "content": "## Video Upload & Post-Processing\nUpload the final video to YouTube using the YouTube API and update your Google Sheets with upload statuses and YouTube links."
      }
    }
  ],
  "connections": {
    "Read output file": {
      "main": [
        [
          {
            "node": "Upload Video to YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Quote Data": {
      "main": [
        [
          {
            "node": "Merge File Selection Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start AutoClip Workflow": {
      "main": [
        [
          {
            "node": "Retrieve Quote Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "List Video Background Files",
            "type": "main",
            "index": 0
          },
          {
            "node": "Configure Music Background Folder ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to YouTube": {
      "main": [
        [
          {
            "node": "Update Quote Upload Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Final Video Clip": {
      "main": [
        [
          {
            "node": "Initiate YouTube Resumable Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge File Selection Data": {
      "main": [
        [
          {
            "node": "Select Random Video, Music & Quote",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Quote Upload Status": {
      "main": [
        [
          {
            "node": "Mark Background as Used",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Music Background Files": {
      "main": [
        [
          {
            "node": "Retrieve Music Background Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Video Background Files": {
      "main": [
        [
          {
            "node": "Retrieve Video Background Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Music Background Locally": {
      "main": [
        [
          {
            "node": "Prepare Overlay Text (Quote & Author)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Video Background Locally": {
      "main": [
        [
          {
            "node": "Download Selected Music Background",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Music Background Data": {
      "main": [
        [
          {
            "node": "Merge File Selection Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Retrieve Video Background Data": {
      "main": [
        [
          {
            "node": "Merge File Selection Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Initiate YouTube Resumable Upload": {
      "main": [
        [
          {
            "node": "Read output file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Selected Music Background": {
      "main": [
        [
          {
            "node": "Save Music Background Locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Selected Video Background": {
      "main": [
        [
          {
            "node": "Save Video Background Locally",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Random Video, Music & Quote": {
      "main": [
        [
          {
            "node": "Download Selected Video Background",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Music Background Folder ID": {
      "main": [
        [
          {
            "node": "List Music Background Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Overlay Text (Quote & Author)": {
      "main": [
        [
          {
            "node": "Generate Final Video Clip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}