{
  "name": "YouTube video optimization & cross-platform distribution with GPT-4o",
  "nodes": [
    {
      "id": "22c6a0e5-ec11-476a-8bf0-dc8deaed1c83",
      "name": "Video Published Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -30656,
        864
      ]
    },
    {
      "id": "3dee4ac8-1e5e-4edf-a1f2-a2cd6a22c557",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -30480,
        864
      ]
    },
    {
      "id": "fea7a4dd-12e3-4a6a-a001-f6a052f4a33c",
      "name": "Get Video Details",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -30256,
        864
      ]
    },
    {
      "id": "efb7456f-72c4-45b1-847d-694ad24a7264",
      "name": "Prepare SEO Prompts",
      "type": "n8n-nodes-base.set",
      "position": [
        -30064,
        864
      ]
    },
    {
      "id": "9347a97c-0e82-4fa3-ba1e-1aa7a9f4a0ad",
      "name": "Fetch Competitor Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -29744,
        832
      ]
    },
    {
      "id": "1d328d98-a261-468d-a529-26fcbee60860",
      "name": "Fetch Trending Topics",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -29760,
        992
      ]
    },
    {
      "id": "b7f2fb0a-1ad3-4958-bf20-ac7232941616",
      "name": "Thumbnail Analysis API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -27024,
        352
      ]
    },
    {
      "id": "dcab7b24-2f38-428c-969b-79ec28aa79a9",
      "name": "Clip Extraction Service",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -27024,
        544
      ]
    },
    {
      "id": "00d37079-d54d-42af-b11c-6718c507f7de",
      "name": "Calculate SEO Score",
      "type": "n8n-nodes-base.code",
      "position": [
        -28560,
        896
      ]
    },
    {
      "id": "91246287-5e99-4ea8-a45b-520595a2f1bf",
      "name": "A/B Title Routing Logic",
      "type": "n8n-nodes-base.code",
      "position": [
        -28368,
        896
      ]
    },
    {
      "id": "2c87022c-8a19-4201-a821-e72ad71bff60",
      "name": "Aggregate Analytics Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -27120,
        1616
      ]
    },
    {
      "id": "29cc190c-aecf-421e-98dc-f98a8565899a",
      "name": "Calculate Engagement Score",
      "type": "n8n-nodes-base.code",
      "position": [
        -26944,
        1616
      ]
    },
    {
      "id": "09fd99b2-437a-4a56-bfa6-a4d7aef00e58",
      "name": "Competitor Comparison",
      "type": "n8n-nodes-base.code",
      "position": [
        -29472,
        896
      ]
    },
    {
      "id": "404981db-18d9-4469-8799-e2c1b007e621",
      "name": "Check Video Length",
      "type": "n8n-nodes-base.if",
      "position": [
        -27312,
        448
      ]
    },
    {
      "id": "f94fa92c-4827-403d-98d6-49b779a6362d",
      "name": "Detect High Engagement",
      "type": "n8n-nodes-base.if",
      "position": [
        -26752,
        1616
      ]
    },
    {
      "id": "708d7735-f112-48db-af5b-54f197d4e6aa",
      "name": "Check Viral Potential",
      "type": "n8n-nodes-base.if",
      "position": [
        -26496,
        1616
      ]
    },
    {
      "id": "e2c67fc3-da30-477a-b9d7-b1561d86be7e",
      "name": "Check Platform Availability",
      "type": "n8n-nodes-base.if",
      "position": [
        -25824,
        448
      ]
    },
    {
      "id": "7b2cdbc3-6928-4b29-9e85-c85eea0307ad",
      "name": "A/B Test Variant Selection",
      "type": "n8n-nodes-base.if",
      "position": [
        -28176,
        896
      ]
    },
    {
      "id": "46633b87-c83b-41f7-84ed-963ea4def66b",
      "name": "Detect Negative Comments",
      "type": "n8n-nodes-base.if",
      "position": [
        -26752,
        1024
      ]
    },
    {
      "id": "17ede704-1587-423a-b78d-cbce7c16b557",
      "name": "Update Video Metadata",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -27792,
        880
      ]
    },
    {
      "id": "6f068d5b-dace-42fe-9acf-43643ecb1034",
      "name": "Fetch Video Analytics",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -27296,
        1616
      ]
    },
    {
      "id": "e0034584-e23d-4752-8bc1-aad2650ebf39",
      "name": "Fetch Video Comments",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -27328,
        1024
      ]
    },
    {
      "id": "65d12f4f-e990-412f-8243-02d03a8137dd",
      "name": "Prepare Cross-Platform Context",
      "type": "n8n-nodes-base.set",
      "position": [
        -26736,
        448
      ]
    },
    {
      "id": "97981719-e989-466f-9b3e-6299d6393391",
      "name": "Format Platform Posts",
      "type": "n8n-nodes-base.set",
      "position": [
        -26112,
        448
      ]
    },
    {
      "id": "8b619e95-c405-4582-b5ae-8bc932c661f0",
      "name": "Post to LinkedIn",
      "type": "n8n-nodes-base.linkedIn",
      "position": [
        -25600,
        160
      ]
    },
    {
      "id": "e7b1a496-1f8c-4c36-be19-f4c627e48705",
      "name": "Post Twitter Thread",
      "type": "n8n-nodes-base.twitter",
      "position": [
        -25600,
        352
      ]
    },
    {
      "id": "a70258df-9d8d-410b-ab9e-9764f03e6ff4",
      "name": "Upload Instagram Reel",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -25600,
        544
      ]
    },
    {
      "id": "ebde6690-6958-469b-b8f4-b7071879e0d7",
      "name": "Post to Facebook Group",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -25600,
        736
      ]
    },
    {
      "id": "3b55c58d-792d-4f04-9220-97af2c39872e",
      "name": "Send Email Newsletter",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        -25792,
        1616
      ]
    },
    {
      "id": "a9e63143-78d1-48d8-af1b-c02533124395",
      "name": "Log to Video Database",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -27872,
        1632
      ]
    },
    {
      "id": "ed09dc2c-7acb-4ef0-bf0e-72f3d2aec029",
      "name": "Log Comments",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -26432,
        1184
      ]
    },
    {
      "id": "8f8b0751-c007-4f31-9576-f6a512ddf6ac",
      "name": "Log Strategic Insights",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -25968,
        1616
      ]
    },
    {
      "id": "9bd3b05b-391d-4a4d-9bb6-36f8c0e143ee",
      "name": "Slack - Video Published Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -27792,
        1248
      ]
    },
    {
      "id": "da20a613-a4f4-4fb1-a534-66ec58ff5ecd",
      "name": "Slack - Viral Potential Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -26432,
        1008
      ]
    },
    {
      "id": "d87340ab-20d6-4aca-aae8-368e9e065b08",
      "name": "Weekly Analytics Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -27456,
        1616
      ]
    },
    {
      "id": "08c2558b-1e40-4c8e-bf63-acb945d43216",
      "name": "Merge SEO Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        -28752,
        880
      ]
    },
    {
      "id": "2fb4774d-ac28-4c3c-8f75-d5a48cb8ad6f",
      "name": "Generate Cross-Platform Content1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -26528,
        448
      ]
    },
    {
      "id": "2dcefdd7-4bbd-44d4-a719-c5af4e6edd6c",
      "name": "Generate Comment Responses1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -27104,
        1024
      ]
    },
    {
      "id": "145c5871-c261-41ae-981f-d497a96e4ff4",
      "name": "Generate Weekly Report1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -26256,
        1616
      ]
    },
    {
      "id": "08fe2e93-8312-490f-b477-8592f4111a90",
      "name": "Set Variant B Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -28176,
        1136
      ]
    },
    {
      "id": "b07b3d66-bcd6-46cc-986f-83e341b0d267",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -30688,
        128
      ],
      "parameters": {
        "width": 928,
        "height": 560,
        "content": "## How it works\nThis workflow automates the full post-publish process for a new YouTube video: SEO optimization, cross-platform promotion, and engagement monitoring.\n\nWhen a new video is published, th"
      }
    },
    {
      "id": "c627b913-885e-4b51-a354-261309e9ee91",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -30688,
        720
      ],
      "parameters": {
        "width": 368,
        "height": 304,
        "content": "## Triggers & Configuration\nStarts on new video publish (webhook) and runs weekly for reporting. Loads environment variables, IDs, and shared settings used across the workflow."
      }
    },
    {
      "id": "750c4cfe-9711-404f-92e9-5f8de7b08187",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -30288,
        720
      ],
      "parameters": {
        "width": 368,
        "height": 304,
        "content": "## Video Intake\nFetches the published video metadata (title/description/tags/stats) and prepares a compact context payload for SEO generation and comparisons."
      }
    },
    {
      "id": "38453d10-a556-4f24-b9ed-b3ca1447a56b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -29888,
        720
      ],
      "parameters": {
        "width": 560,
        "height": 400,
        "content": "## Competitor & Trend Signals\nPulls competitor signals and trending topics, then merges them into a single comparison context used by the AI and scoring steps."
      }
    },
    {
      "id": "f3daa799-269a-4b4a-8595-c44d55857f7b",
      "name": "Generate Title Variations",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -29168,
        704
      ]
    },
    {
      "id": "572f0235-b68b-4406-aca3-6ac0e401afd2",
      "name": "Generate SEO Description",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -29168,
        896
      ]
    },
    {
      "id": "04c86bb5-e54b-48d6-b51b-a4dda3e846b2",
      "name": "Generate Tags",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -29168,
        1104
      ]
    },
    {
      "id": "34fe2254-db25-4594-99d4-1fec9f89ee0e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -29296,
        592
      ],
      "parameters": {
        "width": 672,
        "height": 688,
        "content": "## Generate SEO Assets (AI)\nGenerates title variations, SEO description, and tags from the merged context, then consolidates all outputs into one structured SEO payload."
      }
    },
    {
      "id": "1558d101-dcb7-4cc9-beae-2e62a0ecd146",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -28592,
        800
      ],
      "parameters": {
        "width": 576,
        "height": 480,
        "content": "## SEO Scoring & A/B Selection\nScores the generated SEO assets and applies A/B routing logic to select the final title variant to push to YouTube."
      }
    },
    {
      "id": "3f8dd8f2-7b11-48de-8ae9-fd038f36a57f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27920,
        768
      ],
      "parameters": {
        "width": 368,
        "height": 272,
        "content": "## Update YouTube Metadata\nApplies the selected title, description, and tags to the published video via the YouTube update step."
      }
    },
    {
      "id": "666eee34-1adb-41ca-9f31-b0066a7ecc22",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27360,
        256
      ],
      "parameters": {
        "width": 768,
        "height": 448,
        "content": "## Clip & Thumbnail Processing\nIf the video meets the configured length threshold, runs thumbnail analysis and triggers clip/shorts extraction for promotion assets."
      }
    },
    {
      "id": "d8e56b0a-3867-41d9-99f3-112dfb7c94f0",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -26560,
        96
      ],
      "parameters": {
        "width": 1136,
        "height": 800,
        "content": "## Cross-Platform Promotion\nBuilds platform-specific promo context, generates copy, formats posts, checks enabled platforms, and publishes to each connected channel."
      }
    },
    {
      "id": "bacf73c9-d5a7-4b0f-b57f-971df994cf87",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27376,
        928
      ],
      "parameters": {
        "width": 1120,
        "height": 416,
        "content": "## Comments Monitoring & Logging\nFetches comments, drafts reply suggestions, detects negative sentiment, and logs comments plus responses to Google Sheets for tracking."
      }
    },
    {
      "id": "693a4960-ab2c-41c5-adcc-448dda72e265",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27920,
        1504
      ],
      "parameters": {
        "width": 352,
        "height": 288,
        "content": "## Storage (Video Database)\nLogs the video record and SEO score to Google Sheets to keep a historical dataset for reporting and optimization."
      }
    },
    {
      "id": "9fc344da-f611-46b5-b430-06598bf66968",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27504,
        1520
      ],
      "parameters": {
        "width": 1904,
        "height": 272,
        "content": "## Weekly Analytics & Reporting\nCollects weekly video analytics, aggregates performance, calculates engagement and viral indicators, logs insights, and emails a weekly report/newsletter."
      }
    },
    {
      "id": "67685efc-c6b4-4906-b47a-988d28ea1a99",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -27840,
        1120
      ],
      "parameters": {
        "width": 272,
        "height": 304,
        "content": "## Alerts & Notifications\nSends immediate Slack alerts when a new video is published\n"
      }
    }
  ],
  "connections": {
    "Generate Tags": {
      "main": [
        [
          {
            "node": "Merge SEO Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Merge SEO Data": {
      "main": [
        [
          {
            "node": "Calculate SEO Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video Details": {
      "main": [
        [
          {
            "node": "Prepare SEO Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Video Length": {
      "main": [
        [
          {
            "node": "Thumbnail Analysis API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Clip Extraction Service",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variant B Data": {
      "main": [
        [
          {
            "node": "Update Video Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate SEO Score": {
      "main": [
        [
          {
            "node": "A/B Title Routing Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare SEO Prompts": {
      "main": [
        [
          {
            "node": "Fetch Competitor Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Trending Topics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Video Comments": {
      "main": [
        [
          {
            "node": "Generate Comment Responses1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Viral Potential": {
      "main": [
        [
          {
            "node": "Generate Weekly Report1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Competitor Comparison": {
      "main": [
        [
          {
            "node": "Generate Title Variations",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate SEO Description",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Competitor Data": {
      "main": [
        [
          {
            "node": "Competitor Comparison",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Trending Topics": {
      "main": [
        [
          {
            "node": "Competitor Comparison",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Video Analytics": {
      "main": [
        [
          {
            "node": "Aggregate Analytics Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Platform Posts": {
      "main": [
        [
          {
            "node": "Check Platform Availability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Video Metadata": {
      "main": [
        [
          {
            "node": "Check Video Length",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Video Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Slack - Video Published Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Video Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect High Engagement": {
      "main": [
        [
          {
            "node": "Check Viral Potential",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Strategic Insights": {
      "main": [
        [
          {
            "node": "Send Email Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Thumbnail Analysis API": {
      "main": [
        [
          {
            "node": "Prepare Cross-Platform Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Get Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "A/B Title Routing Logic": {
      "main": [
        [
          {
            "node": "A/B Test Variant Selection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clip Extraction Service": {
      "main": [
        [
          {
            "node": "Prepare Cross-Platform Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Weekly Report1": {
      "main": [
        [
          {
            "node": "Log Strategic Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Video Published Webhook": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Analytics Data": {
      "main": [
        [
          {
            "node": "Calculate Engagement Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detect Negative Comments": {
      "main": [
        [
          {
            "node": "Slack - Viral Potential Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate SEO Description": {
      "main": [
        [
          {
            "node": "Merge SEO Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate Title Variations": {
      "main": [
        [
          {
            "node": "Merge SEO Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Analytics Schedule": {
      "main": [
        [
          {
            "node": "Fetch Video Analytics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "A/B Test Variant Selection": {
      "main": [
        [
          {
            "node": "Update Video Metadata",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Variant B Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Engagement Score": {
      "main": [
        [
          {
            "node": "Detect High Engagement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Platform Availability": {
      "main": [
        [
          {
            "node": "Post to LinkedIn",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Twitter Thread",
            "type": "main",
            "index": 0
          },
          {
            "node": "Upload Instagram Reel",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post to Facebook Group",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Email Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Comment Responses1": {
      "main": [
        [
          {
            "node": "Detect Negative Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Cross-Platform Context": {
      "main": [
        [
          {
            "node": "Generate Cross-Platform Content1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Cross-Platform Content1": {
      "main": [
        [
          {
            "node": "Format Platform Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}