{
  "name": "YouTube video to social media promotion",
  "nodes": [
    {
      "parameters": {
        "content": "## YouTube video to social media promotion\n\n### How it works\n\n1. A manual trigger downloads your YouTube channel feed and parses the XML to the latest video.\n2. The video thumbnail is downloaded, uploaded to Posta, and combined with the video data.\n3. Your active social accounts are selected and de-duplicated to one post per platform.\n4. An LLM writes a promo caption per platform, which is tagged back to each account.\n5. Posta creates the promotion post across the selected networks.\n\n### Setup steps\n\n- [ ] Add your Posta credential (API token) to the Posta nodes\n- [ ] Add your DeepSeek (LLM) credential to the 'Basic LLM Chain' model\n- [ ] Set your YouTube channel feed URL in 'Download YouTube feed'\n- [ ] Confirm the accounts in 'Get many social accounts'\n\n### Customization\n\nSwap the manual trigger for a Schedule trigger to promote each new upload automatically.",
        "width": 480,
        "height": 896
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -848,
        -144
      ],
      "id": "4e36d194-eb12-48fe-8ffd-09dbc45f5f14",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Fetch latest video\n\nStarts the run, downloads the YouTube feed, parses it, and selects the latest video.",
        "width": 976,
        "height": 352,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -288,
        -96
      ],
      "id": "a8f16864-4140-4359-86bb-f3aa5e912fac",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Prepare thumbnail\n\nDownloads the thumbnail, uploads it to Posta, and combines it with the video data.",
        "width": 784,
        "height": 336,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        720,
        -144
      ],
      "id": "cff07305-37a3-4bd8-b7c6-b1b0d9e2e10b",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Select target accounts\n\nLoads social accounts, keeps active ones, and limits to one post per platform.",
        "width": 704,
        "height": 416,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        496,
        432
      ],
      "id": "c349713b-94a5-4985-9d16-51e00eda3b25",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "## Generate captions with AI\n\nCombines the video with platforms and writes a tagged promo caption per platform.",
        "width": 944,
        "height": 464,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1552,
        -80
      ],
      "id": "43007709-31a8-4af9-9c38-8ed152ac2d3a",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Assemble and publish\n\nMerges captions per active account and creates the promotion post.",
        "width": 496,
        "height": 304,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2640,
        -96
      ],
      "id": "a6fabe76-fa14-4899-9761-9d80d672b198",
      "name": "Sticky Note5"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -240,
        64
      ],
      "id": "c7c80056-b1b1-4e79-b96d-9a2c751d4a3a",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "socialAccountIds": "= {{ $json.id.toString() }}",
        "caption": "={{ $json.caption }}{{ $json.url }}",
        "additionalFields": {
          "mediaIds": "={{ $('Upload media').item.json.media.id }}",
          "isDraft": true
        },
        "platformConfigurations": {
          "linkedin": {
            "documentTitle": "={{ $json.title }}"
          }
        }
      },
      "type": "n8n-nodes-posta.posta",
      "typeVersion": 1,
      "position": [
        2992,
        32
      ],
      "id": "e11a8e5b-77d2-444a-a04b-5f074f5fa658",
      "name": "Create a post",
      "credentials": {
        "postaApi": {
          "id": "B35JRmx3PNisTqmS",
          "name": "Posta account"
        }
      }
    },
    {
      "parameters": {
        "resource": "socialAccount"
      },
      "type": "n8n-nodes-posta.posta",
      "typeVersion": 1,
      "position": [
        544,
        688
      ],
      "id": "935a6f34-9170-4830-90dc-d2764530b323",
      "name": "Get many social accounts",
      "credentials": {
        "postaApi": {
          "id": "B35JRmx3PNisTqmS",
          "name": "Posta account"
        }
      }
    },
    {
      "parameters": {
        "resource": "media"
      },
      "type": "n8n-nodes-posta.posta",
      "typeVersion": 1,
      "position": [
        1024,
        -32
      ],
      "id": "d0c501b4-01f4-4066-a940-fe751214f6ca",
      "name": "Upload media",
      "credentials": {
        "postaApi": {
          "id": "B35JRmx3PNisTqmS",
          "name": "Posta account"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $json.thumbnail }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        768,
        -32
      ],
      "id": "6518497f-ad13-4b04-8208-bdedc0c6378c",
      "name": "Download thumbnail"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1360,
        32
      ],
      "id": "b35f43aa-662f-4d34-923c-dd9bee67fb6e",
      "name": "Combine thumbnail + video data"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.xml",
      "typeVersion": 1,
      "position": [
        288,
        96
      ],
      "id": "17c8f927-4708-4b2c-a91f-13bea3a82dea",
      "name": "Parse feed XML"
    },
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UC6vsUGbvtdWizEn1GZDT1ZQ",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        48,
        16
      ],
      "id": "104ab147-429a-42a1-a26e-250d6a4d6e64",
      "name": "Download YouTube feed"
    },
    {
      "parameters": {
        "jsCode": "const root = $input.first().json;\n  const entries = [].concat(root.feed?.entry ?? []).slice(0, 1);  // latest only\n  return entries.map(e => {\n    const g = e['media:group'] ?? {};\n    return { json: {\n      videoId:     e['yt:videoId'],\n      title:       typeof e.title === 'string' ? e.title : e.title?._,\n      description: g['media:description'],\n      thumbnail:   g['media:thumbnail']?.url,\n      url:         e.link?.href ?? e.link?.url,\n      published:   e.published,\n    }};\n  });"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        544,
        80
      ],
      "id": "a0247b4b-55c4-40a4-8af4-fe76eda01adc",
      "name": "Latest video"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "965b8dcb-cbbf-4a09-be7d-91190b09681e",
              "leftValue": "={{ $json.isActive }}",
              "rightValue": false,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            },
            {
              "id": "0650294d-1302-4d4b-97ed-14826faddb9a",
              "leftValue": "",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        784,
        544
      ],
      "id": "214f8125-bd77-40d0-b2b6-5d83dc672e5a",
      "name": "Keep active accounts"
    },
    {
      "parameters": {
        "compare": "selectedFields",
        "fieldsToCompare": "platform",
        "options": {}
      },
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "position": [
        1056,
        544
      ],
      "id": "d2ba6b8c-5b56-4235-8017-4638ef8dd54d",
      "name": "One post per platform"
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineAll",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1600,
        32
      ],
      "id": "4ab71d12-58c4-4ff6-a09c-7335ed70b9d2",
      "name": "Combine video + platforms"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Write a {{ $json.platform }} post promoting this YouTube video:\n  Title: {{ $json.title }}\n  Description: {{ $json.description }}\n  Tailor it to {{ $json.platform }} (tone, length, hashtags). Return only the caption.",
        "messages": {
          "messageValues": [
            {
              "message": "You are the best social media marketing expert in the world."
            }
          ]
        },
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.9,
      "position": [
        2000,
        32
      ],
      "id": "fa7c6508-5890-457d-a86a-543d1da3346f",
      "name": "Basic LLM Chain"
    },
    {
      "parameters": {
        "model": "deepseek-v4-pro",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        2032,
        240
      ],
      "id": "cc716326-2cb9-491a-9adf-b09a21f00d87",
      "name": "DeepSeek Chat Model",
      "credentials": {
        "deepSeekApi": {
          "id": "xqHl99v85iZxuO1j",
          "name": "DeepSeek account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const ctx = $('Combine video + platforms').all();   // ← your cross-join node's name\n  return $input.all().map((item, i) => {\n    const videoUrl = `https://www.youtube.com/watch?v=${ctx[i].json.videoId}`;\n    return {\n      json: {\n        platform: ctx[i].json.platform,\n        videoId:  ctx[i].json.videoId,\n        mediaId:  ctx[i].json.mediaId,\n        url:      videoUrl,\n        caption:  `${item.json.text}\\n\\n▶️  Watch: ${videoUrl}`,\n      },\n    };\n  });"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2352,
        32
      ],
      "id": "4099d081-9007-4aba-a633-352acb376558",
      "name": "Tag captions with platform"
    },
    {
      "parameters": {
        "mode": "combine",
        "fieldsToMatchString": "platform",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        2688,
        32
      ],
      "id": "2989b183-7287-457c-82f8-0c879465e8af",
      "name": "Post per active account"
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get many social accounts",
            "type": "main",
            "index": 0
          },
          {
            "node": "Download YouTube feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download thumbnail": {
      "main": [
        [
          {
            "node": "Upload media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload media": {
      "main": [
        [
          {
            "node": "Combine thumbnail + video data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a post": {
      "main": [
        []
      ]
    },
    "Combine thumbnail + video data": {
      "main": [
        [
          {
            "node": "Combine video + platforms",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download YouTube feed": {
      "main": [
        [
          {
            "node": "Parse feed XML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse feed XML": {
      "main": [
        [
          {
            "node": "Latest video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Latest video": {
      "main": [
        [
          {
            "node": "Download thumbnail",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine thumbnail + video data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get many social accounts": {
      "main": [
        [
          {
            "node": "Keep active accounts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep active accounts": {
      "main": [
        [
          {
            "node": "One post per platform",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post per active account",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "One post per platform": {
      "main": [
        [
          {
            "node": "Combine video + platforms",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "DeepSeek Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Combine video + platforms": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Tag captions with platform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag captions with platform": {
      "main": [
        [
          {
            "node": "Post per active account",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post per active account": {
      "main": [
        [
          {
            "node": "Create a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "9fe8204a-40c1-4ddf-af46-b5de082f157f",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "39a3102487046be4b62efd158285575e7be1bc28455490b873f61de6134af3c2"
  },
  "id": "4SD4jWtZQmj48juh",
  "tags": [
    {
      "updatedAt": "2026-06-02T08:57:53.950Z",
      "createdAt": "2026-06-02T08:57:53.950Z",
      "id": "8rcWTt5CS63KQzEw",
      "name": "socialmedia"
    },
    {
      "updatedAt": "2026-06-02T09:01:25.831Z",
      "createdAt": "2026-06-02T09:01:25.831Z",
      "id": "8xBogo6fq3RQfLdT",
      "name": "autopost"
    },
    {
      "updatedAt": "2026-06-02T08:57:45.531Z",
      "createdAt": "2026-06-02T08:57:45.531Z",
      "id": "E2V7Vb6mVjkhPHEs",
      "name": "blog"
    },
    {
      "updatedAt": "2026-06-02T09:01:40.639Z",
      "createdAt": "2026-06-02T09:01:40.639Z",
      "id": "ESvKanJ6OwKaH6u4",
      "name": "posta"
    }
  ]
}
