{
  "name": "Schedule social media posts from local files using UploadToURL, OpenAI, and Buffer",
  "nodes": [
    {
      "id": "f133eb2f-a75f-4891-8adb-b8809a3703a0",
      "name": "📋 Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2256,
        -928
      ],
      "parameters": {
        "width": 560,
        "height": 468,
        "content": "AI Social Media Auto-Scheduler via UploadToURL\nAutomate the bridge between local media files and live social posts. This workflow hosts your assets via UploadToURL, generates platform-specific copy wi"
      }
    },
    {
      "id": "efc15edf-aa70-4916-8862-a9ccf488650f",
      "name": "Section 1 — Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -368
      ],
      "parameters": {
        "width": 420,
        "height": 616,
        "content": "## 1 — Intake & validation\n\n**Webhook → Validate & Enrich → Has Remote URL?**\n\nThe webhook accepts a POST with `fileUrl` or binary data plus `platform`, `tone`, `brand`, `campaignContext`, and optiona"
      }
    },
    {
      "id": "7019ee99-0415-4fe0-bde9-2dc1968482e3",
      "name": "Section 2 — Upload",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -400
      ],
      "parameters": {
        "width": 420,
        "height": 656,
        "content": "## 2 — File hosting via UploadToURL\n\n**Upload to URL (×2) → Extract clean URL**\n\nTwo parallel branches handle remote URLs and binary uploads using the native **UploadToURL community node** — no custom"
      }
    },
    {
      "id": "dac3623b-f83e-4c52-ba1e-07f1fb18e8b3",
      "name": "Section 3 — Caption",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -352
      ],
      "parameters": {
        "width": 420,
        "height": 548,
        "content": "## 3 — AI caption generation\n\n**OpenAI → Assemble post payload**\n\nOpenAI GPT-4.1 mini receives the platform, tone, brand, campaign context, and character limit. The response format is set to `json_obj"
      }
    },
    {
      "id": "b40c1ab1-1bbd-4d4a-8f3a-8a9f9a76b8d8",
      "name": "Section 4 — Scheduling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -528
      ],
      "parameters": {
        "width": 420,
        "height": 772,
        "content": "## 4 — Platform routing & scheduling\n\n**Switch → Buffer (Twitter / Instagram / LinkedIn) → Response**\n\nThe Switch node routes on the `platform` value. Each Buffer branch is slightly different: Instagr"
      }
    },
    {
      "id": "864f54db-ad25-43da-88e2-f8d532ca009a",
      "name": "Webhook - Receive Asset",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1296,
        0
      ]
    },
    {
      "id": "884d58fc-3087-4b7a-ae3f-6e726cb0731e",
      "name": "Validate & Enrich Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        -1072,
        0
      ]
    },
    {
      "id": "db7db58d-7cf7-4e62-b803-f63391f1ad04",
      "name": "Has Remote URL?",
      "type": "n8n-nodes-base.if",
      "position": [
        -848,
        0
      ]
    },
    {
      "id": "72d26911-946b-48e2-a036-5e17b33cb72b",
      "name": "Upload to URL - From Remote URL",
      "type": "n8n-nodes-uploadtourl.uploadToUrl",
      "position": [
        -624,
        -128
      ]
    },
    {
      "id": "802f6c34-2f99-456a-aa49-51e158d8a539",
      "name": "Upload to URL - From Binary",
      "type": "n8n-nodes-uploadtourl.uploadToUrl",
      "position": [
        -624,
        112
      ]
    },
    {
      "id": "05fd0d9d-9d64-4b79-b01c-e9b320df2bac",
      "name": "Extract Clean URL",
      "type": "n8n-nodes-base.code",
      "position": [
        -416,
        0
      ]
    },
    {
      "id": "110bd7b7-39bd-4253-9270-1e5b4709d6c1",
      "name": "OpenAI - Generate Caption",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -192,
        0
      ]
    },
    {
      "id": "2c2f4205-31a3-44f9-8a99-b498bd1cd094",
      "name": "Assemble Post Payload",
      "type": "n8n-nodes-base.code",
      "position": [
        112,
        0
      ]
    },
    {
      "id": "5e6319f4-40e9-44e2-8ec3-b743a6d6fa4d",
      "name": "Route by Platform",
      "type": "n8n-nodes-base.switch",
      "position": [
        256,
        0
      ]
    },
    {
      "id": "dcc70bd8-774f-4579-9cbc-81abd7fd848e",
      "name": "Buffer - Schedule Twitter/X",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        -160
      ]
    },
    {
      "id": "0e273c5b-45f8-4daa-9ab9-e523bae33f05",
      "name": "Buffer - Schedule Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        16
      ]
    },
    {
      "id": "7bd22a5a-b101-4811-b559-96d93269384d",
      "name": "Buffer - Schedule LinkedIn",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        160
      ]
    },
    {
      "id": "2ad95a6f-8c6b-4649-b2c3-e0b8fdfbab58",
      "name": "Build Final Response",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        0
      ]
    },
    {
      "id": "6b130b72-a224-4a00-920c-be81955b6abe",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        912,
        0
      ]
    }
  ],
  "connections": {
    "Has Remote URL?": {
      "main": [
        [
          {
            "node": "Upload to URL - From Remote URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload to URL - From Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Clean URL": {
      "main": [
        [
          {
            "node": "OpenAI - Generate Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Platform": {
      "main": [
        [
          {
            "node": "Buffer - Schedule Twitter/X",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Buffer - Schedule Instagram",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Buffer - Schedule LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Final Response": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assemble Post Payload": {
      "main": [
        [
          {
            "node": "Route by Platform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Receive Asset": {
      "main": [
        [
          {
            "node": "Validate & Enrich Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - Generate Caption": {
      "main": [
        [
          {
            "node": "Assemble Post Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Enrich Payload": {
      "main": [
        [
          {
            "node": "Has Remote URL?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buffer - Schedule LinkedIn": {
      "main": [
        [
          {
            "node": "Build Final Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buffer - Schedule Instagram": {
      "main": [
        [
          {
            "node": "Build Final Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buffer - Schedule Twitter/X": {
      "main": [
        [
          {
            "node": "Build Final Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to URL - From Binary": {
      "main": [
        [
          {
            "node": "Extract Clean URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to URL - From Remote URL": {
      "main": [
        [
          {
            "node": "Extract Clean URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}