{
  "name": "bundle.social: Google Drive to Facebook",
  "nodes": [
    {
      "parameters": {
        "content": "## Google Drive to Facebook\n\nEvery new image in a Google Drive folder is uploaded to bundle.social and published on Facebook 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 Facebook account connected.\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": "40581460-fa64-51ab-b6c6-df04f1b7c3bf",
      "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": "5019c835-622e-5ec7-a18d-317e6b790593",
      "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": "b97f5e60-18f5-55f9-a8f4-be8a2b18a856",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              },
              "leftValue": "={{ $json.mimeType }}",
              "rightValue": "image/"
            }
          ]
        }
      },
      "id": "8a7f4fe1-a6dd-568e-a70b-4ba13657cdc6",
      "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": "04d71973-40dc-5a3b-adf2-634babd04e69",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "resource": "upload",
        "operation": "uploadFile",
        "binaryPropertyName": "data",
        "additionalFields": {}
      },
      "id": "6be36910-8a16-5753-a180-29852a03c314",
      "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": [
          "FACEBOOK"
        ],
        "dataFacebook": {
          "type": "POST",
          "text": "={{ $('New file in Drive folder').item.json.name.replace(/\\.[^.]+$/, '') }}",
          "uploadIds": "={{ $json.id }}"
        }
      },
      "id": "f8ace6e8-400e-5f4a-990f-aea4224fa4ca",
      "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": {}
}