{
  "name": "Publish to 9 Social Platforms",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -100,
        660
      ],
      "id": "24d0e1c7-7aa3-47d9-9169-08c1d0a447a6",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1gM1hHpqKMkwTrgTqFEDPHR-ee-oWyxQlFPl14h2demQ",
          "mode": "list",
          "cachedResultName": "Publish to 9 Social Platforms",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gM1hHpqKMkwTrgTqFEDPHR-ee-oWyxQlFPl14h2demQ/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gM1hHpqKMkwTrgTqFEDPHR-ee-oWyxQlFPl14h2demQ/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Status",
              "lookupValue": "Ready to Post"
            }
          ]
        },
        "options": {
          "returnFirstMatch": true
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        120,
        660
      ],
      "id": "e327136d-9242-4bfa-91a7-b84aecb3af47",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fMk6TcjDgUxQTCa2",
          "name": "Google Sheets - Brand"
        }
      }
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "{n  "blotato_api_key": "",n  "instagram_id": "",n  "youtube_id": "",n  "tiktok_id": "",n  "facebook_id": "",n  "facebook_page_id": "",n  "threads_id": "",n  "twitter_id": "",n  "linkedin_id": "",n  "pinterest_id": "",n  "pinterest_board_id": "",n  "bluesky_id": ""n}",
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        560,
        660
      ],
      "id": "435fce73-d449-4b69-8e24-595d464e4640",
      "name": "Setup Social Accounts"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a1750d20-2f6e-4826-80b8-654d0985120d",
              "name": "final_google_drive_url",
              "value": "={{ $('Google Sheets').item.json['Video URL (google drive)'].match(/\/d\/([A-Za-z0-9]+-[A-Za-z0-9]+)/i)[1] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        340,
        660
      ],
      "id": "e2bc8d78-7029-4388-a46a-99e28ca5573e",
      "name": "Get Google Drive ID"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/media",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "=https://drive.google.com/uc?export=download&id={{ $('Get Google Drive ID').item.json.final_google_drive_url }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        780,
        660
      ],
      "id": "e0320328-98a8-4f5d-8c60-b16e0977f169",
      "name": "Upload to Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "instagram"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "instagram",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.instagram_id }}"n  }n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1000,
        -140
      ],
      "id": "8b859ba4-6cfa-4b3c-b0dd-37f7a252073e",
      "name": "[Instagram] Publish via Blotato",
      "disabled": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "facebook",n      "pageId": "{{ $('Setup Social Accounts').item.json.facebook_page_id }}"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "facebook",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.facebook_id }}"n  }n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1000,
        200
      ],
      "id": "930a5cd1-3f44-40d0-950c-12d49324e378",
      "name": "[Facebook] Publish via Blotato",
      "disabled": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "linkedin"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "linkedin",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.linkedin_id }}"n  }n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1000,
        660
      ],
      "id": "6d169f37-e48f-4f80-8992-600ef3dffb6b",
      "name": "[Linkedin] Publish via Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "tiktok",n      "isYourBrand": false,n      "disabledDuet": false,n      "privacyLevel": "PUBLIC_TO_EVERYONE",n      "isAiGenerated": false,n      "disabledStitch": false,n      "disabledComments": false,n      "isBrandedContent": falsen    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "tiktok",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.tiktok_id }}"n  }n}n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1000,
        1060
      ],
      "id": "8a24602a-bdd4-4194-bfa7-c27da97262f5",
      "name": "[Tiktok] Publish via Blotato"
    },
    {
      "parameters": {
        "resource": "image",
        "prompt": "Image of a manatee staring in the mirror at its AI avatar.",
        "options": {
          "returnImageUrls": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        1000,
        1460
      ],
      "id": "765e9629-11df-4a73-afc8-65cb84b7b0d9",
      "name": "OpenAI",
      "credentials": {
        "openAiApi": {
          "id": "kiPdrnG34bMG8lqa",
          "name": "OpenAI - Brand"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/media",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.url }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1220,
        1460
      ],
      "id": "772e9856-0d1d-437c-af1b-a0fb3c7b04f6",
      "name": "Upload to Blotato - Image"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "pinterest",n      "boardId": "{{ $('Setup Social Accounts').item.json.pinterest_board_id }}",n      "link": "https://www.tiktok.com/@sabrina_ramonov"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "pinterest",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.pinterest_id }}"n  }n}n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1440,
        1460
      ],
      "id": "3b3e8c49-ba30-4c6b-892e-c145e2fbb1ce",
      "name": "[Pinterest] Publish via Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "youtube",n      "title": "TEST VIDEO",n      "privacyStatus": "public",n      "shouldNotifySubscribers": truen    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.toJsonString() }},n      "platform": "youtube",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.youtube_id }}"n  }n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1360,
        -140
      ],
      "id": "b5422234-98a3-4c44-8286-a6ffe7eda70b",
      "name": "[Youtube] Publish via Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "threads"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.slice(0, 500).toJsonString() }},n      "platform": "threads",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.threads_id }}"n  }n}n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1360,
        200
      ],
      "id": "6481e926-27e4-4a88-a157-aa83055ea45f",
      "name": "[Threads] Publish via Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "twitter"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.slice(0, 280).toJsonString() }},n      "platform": "twitter",n      "mediaUrls": ["{{ $json.url }}"]n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.twitter_id }}"n  }n}n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1360,
        660
      ],
      "id": "8689b83e-bab6-4668-a84a-19c050815ef9",
      "name": "[Twitter] Publish via Blotato"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://backend.blotato.com/v2/posts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "blotato-api-key",
              "value": "={{ $('Setup Social Accounts').item.json.blotato_api_key }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={n  "post": {n    "target": {n      "targetType": "bluesky"n    },n    "content": {n      "text": {{ $('Google Sheets').item.json.Caption.slice(0, 280).toJsonString() }},n      "platform": "bluesky",n      "mediaUrls": []n    },n    "accountId": "{{ $('Setup Social Accounts').item.json.bluesky_id }}"n  }n}n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1360,
        1060
      ],
      "id": "34f7755a-6191-4fef-82cf-3b6ffb6f955f",
      "name": "[Bluesky] Publish via Blotato"
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Get Google Drive ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup Social Accounts": {
      "main": [
        [
          {
            "node": "Upload to Blotato",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Blotato": {
      "main": [
        [
          {
            "node": "[Instagram] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Facebook] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Linkedin] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Tiktok] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Youtube] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Threads] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Twitter] Publish via Blotato",
            "type": "main",
            "index": 0
          },
          {
            "node": "[Bluesky] Publish via Blotato",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Google Drive ID": {
      "main": [
        [
          {
            "node": "Setup Social Accounts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Upload to Blotato - Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Blotato - Image": {
      "main": [
        [
          {
            "node": "[Pinterest] Publish via Blotato",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7fbd2d77-7df6-40a0-87c3-522078c91946",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "549c75b884f60826462aba44926da2b62a58c76fa3ad0b40e11aceb92998328c"
  },
  "id": "xtzZWhbqvWKYtrMB",
  "tags": []
}