{
  "nodes": [
    {
      "id": "main-sticky-note-001",
      "name": "Sticky Note Main",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        48
      ],
      "parameters": {
        "width": 400,
        "height": 520,
        "content": "# Video Subtitle Workflow\n\nAdd subtitles to YouTube videos and save to Google Drive automatically.\n\n### How it works\n1. Submit YouTube video URL via form\n2. Video uploaded to VideoDB for processing\n3. Spoken words indexed for transcription\n4. Subtitles burned into the video\n5. Subtitled video saved to Google Drive\n\n### Setup steps\n1. Add **VideoDB API** credentials\n2. Configure **Google Drive** OAuth credentials\n3. Update target folder ID in Google Drive node\n4. Activate workflow and submit videos via form"
      },
      "typeVersion": 1
    },
    {
      "id": "7df6bd71-c844-4cd3-ba3d-83a1c8bfb67d",
      "name": "Upload Video to VideoDB",
      "type": "@videodb/n8n-nodes-videodb.videoDb",
      "position": [
        576,
        256
      ],
      "parameters": {
        "url": "={{ $json['Youtube Video URL'] }}",
        "name": "=",
        "operation": "upload",
        "description": "File to be dubbed to French",
        "collection_id": ""
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "473f2300-1ace-4b4a-b8f6-e52bf567dbcd",
      "name": "Wait Before Upload Status Check",
      "type": "n8n-nodes-base.wait",
      "position": [
        800,
        256
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "ee9799bf-7c91-4597-b871-3f701ea2b51d",
      "name": "Poll Upload Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1024,
        176
      ],
      "parameters": {
        "url": "={{ $('Upload Video to VideoDB').item.json.data.output_url }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "videoDBApi"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "750a7801-fabe-44b1-828b-180b9f8fdd50",
      "name": "Is Upload Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        1248,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b379ca2c-d86d-47d7-9ac9-446ac47721fb",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "complete"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "26c93177-4422-4463-a109-6caa71b340b5",
      "name": "YouTube URL Form Trigger",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        352,
        256
      ],
      "parameters": {
        "options": {},
        "formTitle": "YouTube Video URL to Dub",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Youtube Video URL",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "772394f9-d5c7-404d-82b9-a7d334cf1282",
      "name": "Wait Before Indexing Status Check",
      "type": "n8n-nodes-base.wait",
      "position": [
        1696,
        256
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "60e0b0bc-b421-45f8-914f-794ef0d6e336",
      "name": "Poll Indexing Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        176
      ],
      "parameters": {
        "url": "={{ $('Index Spoken Words').item.json.data.output_url }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "videoDBApi"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "53d37aae-b3ce-4a68-a491-1c56c65567e9",
      "name": "Generate Download Job",
      "type": "@videodb/n8n-nodes-videodb.videoDb",
      "position": [
        2592,
        240
      ],
      "parameters": {
        "name": "={{ $('Poll Upload Status').item.json.response.data.name }}",
        "operation": "download",
        "stream_link": "={{ $json.data.stream_link }}"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "70bf4279-8021-4983-a0a0-ff34de9d9bb5",
      "name": "Wait Before Download Job Check",
      "type": "n8n-nodes-base.wait",
      "position": [
        2816,
        240
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "13a0b5b0-0dbd-4582-b662-dbc5745a0474",
      "name": "Poll Download Job Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3040,
        160
      ],
      "parameters": {
        "url": "={{ $('Generate Download Job').item.json.data.output_url }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "videoDBApi"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b351c25e-32f9-46e4-a8e6-8e256453c35a",
      "name": "Is Download Job Ready",
      "type": "n8n-nodes-base.if",
      "position": [
        3264,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b379ca2c-d86d-47d7-9ac9-446ac47721fb",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "done"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "5faa1557-9dc1-4fa3-be4e-091170bc482a",
      "name": "Download Subtitled Video File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3504,
        224
      ],
      "parameters": {
        "url": "={{ $json.data.download_url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "92438108-723b-45cd-bdb6-92f2a259b715",
      "name": "Upload Subtitled Video to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3728,
        224
      ],
      "parameters": {
        "name": "={{ $json.data.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1YW39wRNL4sHlPLQmM2rnKM5mnCmVOT4W",
          "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID",
          "cachedResultName": "Subtitled Videos"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "daa63ab3-dda9-490b-952c-81101c50f2ce",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 1152,
        "height": 432,
        "content": "# Video Upload to VideoDB"
      },
      "typeVersion": 1
    },
    {
      "id": "da7f83fa-958f-4ba6-b56b-76ec1780e86f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 1072,
        "height": 432,
        "content": "# Indexing the spoken content and Adding Subtitles"
      },
      "typeVersion": 1
    },
    {
      "id": "7ad9f8a0-0e0a-4c64-b646-ea1cf950a094",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2528,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 432,
        "content": "# Generating the Download URL\n"
      },
      "typeVersion": 1
    },
    {
      "id": "77432f3f-4391-4821-aa7e-0679c17954bd",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3424,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 432,
        "content": "# Uploading to GDrive\n"
      },
      "typeVersion": 1
    },
    {
      "id": "edb72ad5-75e8-4b3c-9de1-10e47ef10cd4",
      "name": "Index Spoken Words",
      "type": "@videodb/n8n-nodes-videodb.videoDb",
      "position": [
        1472,
        256
      ],
      "parameters": {
        "video_id": "={{ $('Poll Upload Status').item.json.response.data.id }}",
        "operation": "indexSpokenWords",
        "collection_id": "={{ $('Poll Upload Status').item.json.response.data.collection_id }}",
        "language_code": "en_us"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1a7255b3-39c5-44ad-b547-28b61f5d1fa3",
      "name": "Is Indexing Complete",
      "type": "n8n-nodes-base.if",
      "position": [
        2144,
        256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b379ca2c-d86d-47d7-9ac9-446ac47721fb",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "done"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "9dfb8825-2bf9-481e-8ae9-5e39f37bbb43",
      "name": "Add Subtitle to Video",
      "type": "@videodb/n8n-nodes-videodb.videoDb",
      "position": [
        2352,
        240
      ],
      "parameters": {
        "video_id": "={{ $('Poll Upload Status').item.json.response.data.id }}",
        "operation": "addSubtitle",
        "collection_id": "={{ $('Poll Upload Status').item.json.response.data.collection_id }}"
      },
      "credentials": {
        "videoDBApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Index Spoken Words": {
      "main": [
        [
          {
            "node": "Wait Before Indexing Status Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Upload Complete": {
      "main": [
        [
          {
            "node": "Index Spoken Words",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Upload Status Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Poll Upload Status": {
      "main": [
        [
          {
            "node": "Is Upload Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Indexing Complete": {
      "main": [
        [
          {
            "node": "Add Subtitle to Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Indexing Status Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Poll Indexing Status": {
      "main": [
        [
          {
            "node": "Is Indexing Complete",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Subtitle to Video": {
      "main": [
        [
          {
            "node": "Generate Download Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Download Job": {
      "main": [
        [
          {
            "node": "Wait Before Download Job Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Download Job Ready": {
      "main": [
        [
          {
            "node": "Download Subtitled Video File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Download Job Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Video to VideoDB": {
      "main": [
        [
          {
            "node": "Wait Before Upload Status Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Poll Download Job Status": {
      "main": [
        [
          {
            "node": "Is Download Job Ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YouTube URL Form Trigger": {
      "main": [
        [
          {
            "node": "Upload Video to VideoDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Subtitled Video File": {
      "main": [
        [
          {
            "node": "Upload Subtitled Video to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Download Job Check": {
      "main": [
        [
          {
            "node": "Poll Download Job Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Upload Status Check": {
      "main": [
        [
          {
            "node": "Poll Upload Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Indexing Status Check": {
      "main": [
        [
          {
            "node": "Poll Indexing Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}