{
  "name": "bundle.social: Google Drive to TikTok",
  "nodes": [
    {
      "parameters": {
        "content": "## Google Drive to TikTok\n\nEvery new video in a Google Drive folder is uploaded to bundle.social and published on TikTok 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 TikTok account connected.\n   TikTok can limit privacy options per creator; if posting fails on privacy, pick another level in **TikTok Settings**.\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": "5c3d406b-b4a0-5f12-b398-4fa4a9a2846c",
      "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": "f5c681ab-b01c-55f7-8a72-bd0552e8e9ee",
      "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": "118d424c-6850-57d5-9b22-a187454ea5d2",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "video/"
            }
          ]
        }
      },
      "id": "a4b02801-27de-5f7e-b702-b7489b950435",
      "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": "10217385-25c5-5f92-93bf-3bf34e1af92e",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "resource": "upload",
        "operation": "uploadLargeFile",
        "binaryPropertyName": "data",
        "additionalFields": {}
      },
      "id": "81d09303-776a-55bb-bba8-628ed199da0e",
      "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": [
          "TIKTOK"
        ],
        "dataTiktok": {
          "type": "VIDEO",
          "text": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '') }}",
          "privacy": "PUBLIC_TO_EVERYONE",
          "uploadIds": "={{ $json.id }}"
        }
      },
      "id": "f3bb2997-d64e-5967-a88f-c0b8be9276f4",
      "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": {}
}