{
  "name": "YouTube video to social media promotion",
  "nodes": [
    {
      "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": {
          "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": {
          "name": "Posta account"
        }
      }
    },
    {
      "parameters": {
        "content": "You need to tell the workflow where to post - call this to get a list of connected social accounts. To sign-up and connect social accounts, visit https://www.getposta.app (14 days free, no credit card required)",
        "height": 480,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        480,
        400
      ],
      "id": "ce7cb33c-f3fb-4674-8095-5b078920aa47",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "You need a token to use the Posta functions. Get one at https://www.getposta.app (14 days free, no credit card required)",
        "height": 128,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -368,
        -128
      ],
      "id": "a75cc4bb-62bd-4011-8f6b-3393355c9548",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## YouTube video → social media\n\n**Who it's for:** creators who want to promote each new video everywhere automatically.\n**What it does:** reads your YouTube feed, grabs the latest video + thumbnail, and drafts promo posts for every platform via Posta.\n\n**How it works:**\n1. Download the YouTube channel feed and parse the latest video.\n2. Upload the thumbnail to Posta (auto-scaled per platform).\n3. Get active accounts; keep one post per platform type.\n4. DeepSeek writes a caption per platform; create draft posts to review.\n\n**Setup:** add your Posta and DeepSeek credentials, and set your channel feed URL. Sign up at https://www.getposta.app (14 days free, no credit card).",
        "height": 240,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -368,
        -384
      ],
      "id": "d8b976b6-bae7-43c3-ae00-6f6859ac7e2f",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "resource": "media"
      },
      "type": "n8n-nodes-posta.posta",
      "typeVersion": 1,
      "position": [
        1024,
        -32
      ],
      "id": "d0c501b4-01f4-4066-a940-fe751214f6ca",
      "name": "Upload media",
      "credentials": {
        "postaApi": {
          "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": {
        "content": "We merge the outputs from upload media (delivers the media id) and the structureed json. Mode \"combine\" and combine by \"position\".",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1264,
        -96
      ],
      "id": "d9965a14-7a44-44da-a682-86368f5ff4ba",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "The post is created by default as \"draft\" in the Posta backend - from this point you can publish it in the next step, or schedule it for later.",
        "height": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2944,
        -96
      ],
      "id": "fc8d4240-17e3-48a0-9da3-cd4d4817fda5",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "Download from the RSS endpoint. n8n strips a lot of data, so use HTTP Request",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -16,
        -96
      ],
      "id": "864c538f-4734-47ec-a1c8-af516a85788b",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "content": "Create json from XML, save it into \"data\"",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        224,
        -96
      ],
      "id": "e3f132c8-47c5-457f-9770-898266739d3b",
      "name": "Sticky Note11"
    },
    {
      "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": {
        "content": "Create structured json. **IMPORTANT:** we limit to the last video here: const entries = [].concat(root.feed?.entry ?? []).slice(0, 1);  // latest only \nChange the way you see fit.",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        480,
        -96
      ],
      "id": "cd80c088-de0f-41d5-a13b-531a0ff7bde9",
      "name": "Sticky Note12"
    },
    {
      "parameters": {
        "content": "Download the Youtube video thumbnails",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        720,
        -96
      ],
      "id": "07b6219f-3fb6-44ef-b562-b70127e94e3a",
      "name": "Sticky Note13"
    },
    {
      "parameters": {
        "content": "Upload the thumbnails to the Posta app.",
        "height": 336
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        976,
        -96
      ],
      "id": "a590913b-ff1a-402d-952f-c33769aacb86",
      "name": "Sticky Note14"
    },
    {
      "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": {
        "content": "We select all active social accounts",
        "height": 480
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        736,
        400
      ],
      "id": "6bf187a4-26fc-4d4f-b94e-5c00c0c01fc4",
      "name": "Sticky Note15"
    },
    {
      "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": {
        "content": "Remove duplicates from platform. We want to create a single post for each platform type (one for TikTok, once for LinkedIn etc), not one post for each account. ",
        "height": 480,
        "width": 224
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        992,
        400
      ],
      "id": "dafaf967-c847-4882-a124-7bbf199c3589",
      "name": "Sticky Note16"
    },
    {
      "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": {
        "content": "Create all possible combinations - this gives a list of post data for each account type that was delivered from upstream",
        "height": 336,
        "width": 288
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1552,
        -96
      ],
      "id": "11c1f549-54c5-4f6d-a999-12e456f8b704",
      "name": "Sticky Note17"
    },
    {
      "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": {
          "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": {
        "content": "The LLM gives only text, so lets add platform so we know what posts to create",
        "height": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2304,
        -96
      ],
      "id": "3ae1905f-f3d9-472e-b1a1-9076ab878949",
      "name": "Sticky Note4"
    },
    {
      "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"
    },
    {
      "parameters": {
        "content": "Now merge the posts with each active account - we create a post for each account. ",
        "height": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2656,
        -96
      ],
      "id": "bbcbd1b7-7103-4bfb-9b37-680a767a1d81",
      "name": "Sticky Note9"
    }
  ],
  "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
  },
  "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"
    }
  ]
}
