{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Generate AI video captions with ZapCap and Google Drive",
  "tags": [],
  "nodes": [
    {
      "id": "452daa5e-5e33-4063-a342-4762f81567f9",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        1232,
        -176
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_DRIVE_FOLDER_ID>>>",
          "cachedResultUrl": "<<<GOOGLE_DRIVE_FOLDER_URL>>>",
          "cachedResultName": "<<<GOOGLE_DRIVE_FOLDER_NAME>>>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "23e88fbd-be88-476b-9f65-d9400bed24d6",
      "name": "Upload video to ZapCap",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1552,
        -176
      ],
      "parameters": {
        "url": "https://api.zapcap.ai/videos/url",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.webViewLink }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "2d528391-6c5b-4898-9557-79a9b674d941",
      "name": "Trigger video processing",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1856,
        -176
      ],
      "parameters": {
        "url": "=https://api.zapcap.ai/videos/{{ $json.id }}/task ",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        },
        "sendBody": true,
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "templateId",
              "value": "ca050348-e2d0-49a7-9c75-7a5e8335c67d"
            },
            {
              "name": "autoApprove",
              "value": "={{ true }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "ttl",
              "value": "1d"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "717e4fde-1a21-4d65-b7b1-c8ea0e0519f7",
      "name": "Get processing task",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2096,
        -176
      ],
      "parameters": {
        "url": "=https://api.zapcap.ai/videos/{{ $('Upload video to ZapCap').item.json.id }}/task/{{$('Trigger video processing').item.json.taskId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "c2352a7d-08bb-481b-819d-c51b345910a0",
      "name": "If processing completed",
      "type": "n8n-nodes-base.if",
      "position": [
        2336,
        -256
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a9b08b06-0f10-4a98-b033-95f93b156d9a",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "=completed"
            },
            {
              "id": "aaa8d677-85e8-4c09-88bc-f3f95cd90283",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d48ef8f1-6715-45a3-b733-2722f8286d4d",
      "name": "Download completed video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2624,
        -272
      ],
      "parameters": {
        "url": "={{ $json.downloadUrl }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "acd2f825-b1d9-4eb1-99fe-3166dc7dc861",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2832,
        -272
      ],
      "parameters": {
        "name": "={{ $('Google Drive Trigger').item.json.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_DRIVE_NAME>>>"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "<<<GOOGLE_DRIVE_FOLDER_ID>>>",
          "cachedResultName": "<<<GOOGLE_DRIVE_FOLDER_NAME>>>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "74fe5b37-d1d2-4deb-9df8-8e65cfbf465d",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        2352,
        -32
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "db1c33e0-ec36-416f-b549-591ea5f44fcd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -480
      ],
      "parameters": {
        "width": 624,
        "height": 720,
        "content": "## \ud83c\udfac Auto Add AI Captions to Videos from Google Drive with ZapCap\n\n### Description\nStop wasting hours on video captioning. Upload your videos to a Google Drive folder, and **ZapCap** automatically generates professional subtitles for you. Download the finished video from your Google Drive and it\u2019s ready to post. Fast, simple, and effortless.\n\n### How It Works\n1. **Google Drive Trigger** \u2013 Watches your folder for new uploads.  \n2. **Send to ZapCap** \u2013 Instantly creates accurate subtitles.  \n3. **Wait & Check Status** \u2013 Automatically tracks progress.  \n4. **Download Captioned Video** \u2013 Get your finished, captioned video.  \n5. **Upload Back to Drive** \u2013 Saves it where you need it, ready to share.\n\n### Why You\u2019ll Love It\n- \ud83d\ude80 **Save time** \u2014 captions are added automatically.  \n- \u26a1 **Speed up content creation** \u2014 get post-ready videos in minutes.  \n- \ud83c\udfaf **Professional results** \u2014 subtitles are accurate and consistent.  \n- \u2601\ufe0f **Fully cloud-based** \u2014 no local software, no manual work.\n\n### Requirements\n- **ZapCap account & API key** \u2014 get your free API key [here](https://platform.zapcap.ai/dashboard/api-key)  \n- **Google Drive account** (with OAuth credentials)  \n- **n8n** (Cloud or self-hosted)\n\n### Support\nNeed help? Join our [ZapCap Discord](https://discord.gg/26fYtvjWBx) or email us at [hi@zapcap.ai](mailto:hi@zapcap.ai) for assistance.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "885d0386-4f97-404d-bd58-d2e14e7038c9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 336,
        "height": 720,
        "content": "## Google drive trigger \nUpload a video to your selected Google Drive to start this workflow"
      },
      "typeVersion": 1
    },
    {
      "id": "4492221e-5666-4b82-ab1f-892b1ca59a02",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 720,
        "content": "## Upload video to ZapCap \nMake sure the folder has given \"Viewer\" access to \"Anyone with the link\"!"
      },
      "typeVersion": 1
    },
    {
      "id": "843ec7db-6d4d-4d1b-990d-9ea1600d9e66",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 784,
        "height": 720,
        "content": "## ZapCap begins processing your video\nThis can take between 30 seconds to 2 minutes depending on the length of your video"
      },
      "typeVersion": 1
    },
    {
      "id": "dee8dcfd-ffd3-4e79-a98a-ae758b5f366d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 432,
        "height": 720,
        "content": "## Captioned video is uploaded to your selected Google Drive folder.\nMake sure to use different source and destination folders for your videos to prevent possible clashes!"
      },
      "typeVersion": 1
    },
    {
      "id": "f905df28-4a11-4b79-895e-b20a6784003e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -672
      ],
      "parameters": {
        "content": "## Note \nRemember to get your API key [here](https://platform.zapcap.ai/dashboard/api-key/). The header auth must use the name `x-api-key`"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Get processing task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get processing task": {
      "main": [
        [
          {
            "node": "If processing completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Upload video to ZapCap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload video to ZapCap": {
      "main": [
        [
          {
            "node": "Trigger video processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If processing completed": {
      "main": [
        [
          {
            "node": "Download completed video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download completed video": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger video processing": {
      "main": [
        [
          {
            "node": "Get processing task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}