{
  "name": "bundle.social: Google Drive to Pinterest",
  "nodes": [
    {
      "parameters": {
        "content": "## Google Drive to Pinterest\n\nEvery new image in a Google Drive folder is uploaded to bundle.social and published on Pinterest 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 Pinterest account connected.\n   Replace **Board Name** in **Pinterest Settings** with the name of one of your boards.\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": "004fced4-e15d-5ee3-927d-82fc09f3fcdf",
      "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": "a51d13c9-3326-5928-bbdb-6c87182d03ea",
      "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": "aacb765b-648a-5519-9c5a-e73f1532772a",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "image/"
            }
          ]
        }
      },
      "id": "2cdce532-34a3-594a-93a9-fc97307f3174",
      "name": "Only images",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {}
      },
      "id": "e2cfa093-efbd-5523-8a4b-78aea39c4529",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "resource": "upload",
        "operation": "uploadFile",
        "binaryPropertyName": "data",
        "additionalFields": {}
      },
      "id": "fb6a05a9-7a25-58b9-b460-4694dcf94fbe",
      "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": [
          "PINTEREST"
        ],
        "dataPinterest": {
          "boardName": "REPLACE_WITH_YOUR_BOARD_NAME",
          "text": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '').slice(0, 100) }}",
          "description": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '') }}",
          "uploadIds": "={{ $json.id }}"
        }
      },
      "id": "8b8bb2a5-5390-581d-80f0-409fe5690502",
      "name": "Create post",
      "type": "n8n-nodes-bundlesocial.bundleSocial",
      "typeVersion": 1,
      "position": [
        960,
        0
      ]
    }
  ],
  "connections": {
    "New file in Drive folder": {
      "main": [
        [
          {
            "node": "Only images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only images": {
      "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": {}
}