{
  "name": "Extract viral-worthy clips from YouTube videos with Gemini AI & FFmpeg editing",
  "nodes": [
    {
      "id": "d2344cd1-5b80-4b89-a3f3-80248db92fce",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -832,
        448
      ]
    },
    {
      "id": "6bd570a9-4b12-4e77-b93f-bb6c6705ba55",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        192,
        432
      ]
    },
    {
      "id": "8e65f7a7-4de8-4695-bcd4-d8cd73136ca1",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -784,
        1472
      ]
    },
    {
      "id": "1705113f-0680-428c-924b-0aea7d8e8944",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -832,
        112
      ]
    },
    {
      "id": "8743a053-8bfc-4bcb-9ca9-6608ddff395e",
      "name": "get the downloaded video location",
      "type": "n8n-nodes-base.code",
      "position": [
        1088,
        144
      ]
    },
    {
      "id": "a384e44f-ecaa-4c6a-b53d-e3f69efa782b",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -464,
        864
      ]
    },
    {
      "id": "d190393a-2d10-43c7-8ed3-9504042b2fc2",
      "name": "Loop Over Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        192,
        1360
      ]
    },
    {
      "id": "8fa6b348-9a74-4a23-bcae-9af1f5e5064d",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1072,
        960
      ]
    },
    {
      "id": "de125fd9-72c4-4cdf-8121-46c81daa8e72",
      "name": "EDITING",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -176,
        1360
      ]
    },
    {
      "id": "03da8733-c559-4b94-bbce-113c49391e81",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -16,
        1360
      ]
    },
    {
      "id": "ce53e11d-71e9-412a-a133-dbb68c828578",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1232,
        848
      ]
    },
    {
      "id": "9a213ba8-88e1-4737-b9f5-8e2562517095",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        0
      ],
      "parameters": {
        "width": 720,
        "height": 1120,
        "content": "# 🎬 AI-Powered YouTube Clip Creator\n\nTransform long-form YouTube videos into viral-ready short clips automatically using AI analysis and professional editing.\n\n## What This Workflow Does\n\n1. **Downloa"
      }
    },
    {
      "id": "37caaaa7-158e-4c09-9ef3-12e0fa70ecb6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        16
      ],
      "parameters": {
        "width": 2416,
        "height": 736,
        "content": "## Initial Download and identification of clips:- \n### used FFMPEG, Gemini & YT-DLP"
      }
    },
    {
      "id": "88b55c17-b921-4d8a-87c8-6675a46f8f8b",
      "name": "video download with yt-dlp",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -464,
        160
      ]
    },
    {
      "id": "5571f1bf-b302-4372-bba6-ba6287ab6b68",
      "name": "get transcript from yt-dlp",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -448,
        432
      ]
    },
    {
      "id": "34e62147-5f65-417c-98d4-f731c3fddb36",
      "name": "extract filepath",
      "type": "n8n-nodes-base.code",
      "position": [
        -208,
        432
      ]
    },
    {
      "id": "80e059a0-6145-4deb-a2e0-5aab4ef9b95a",
      "name": "read srt from disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -16,
        432
      ]
    },
    {
      "id": "b769ef5b-c339-4fec-817b-86fac4f94f98",
      "name": "formating of data",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        432
      ]
    },
    {
      "id": "5d43acbb-a45e-4ceb-8692-a819aa8c58ae",
      "name": "some more formating",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        432
      ]
    },
    {
      "id": "2395ac82-d71b-4964-9839-bf522e29161a",
      "name": "viral clips identification",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        800,
        432
      ]
    },
    {
      "id": "d11dc961-a42a-4788-8194-5403ca021f29",
      "name": "filter out top clips according to score",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        432
      ]
    },
    {
      "id": "43311265-2728-4e66-9540-10383dfa1f8e",
      "name": "wait for both branches to complete and merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1360,
        272
      ]
    },
    {
      "id": "774311aa-8de9-478b-9bee-7dd5933ce18f",
      "name": "seperate actionable data items",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        544
      ]
    },
    {
      "id": "e2d9696e-3278-487b-9a37-4f85cad468b4",
      "name": "simple clipping (still in orignal aspect ratio)",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        -592,
        1488
      ]
    },
    {
      "id": "9ebb066b-4af9-4140-a488-dfdfc380dd5b",
      "name": "extract all clips paths",
      "type": "n8n-nodes-base.code",
      "position": [
        -768,
        880
      ]
    },
    {
      "id": "39442dc5-76a5-4f6f-9e00-7ecfaa399f3b",
      "name": "Read clips from disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -160,
        944
      ]
    },
    {
      "id": "4ceee2b8-7e5d-4434-94fb-11f6d8098a95",
      "name": "extract clip file in base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        64,
        944
      ]
    },
    {
      "id": "d3c796d7-67fe-4a27-b744-0a2f11431d5a",
      "name": "convert base64 to actual binary file",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        304,
        944
      ]
    },
    {
      "id": "13aceeda-9bce-4a59-89dd-41302a0241dc",
      "name": "Analyze the actual whole video",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        544,
        944
      ]
    },
    {
      "id": "e811973a-16c6-4c91-8a01-c41c497bebd9",
      "name": "extract all actionable operations",
      "type": "n8n-nodes-base.code",
      "position": [
        752,
        944
      ]
    },
    {
      "id": "0f504a64-9e4c-4fc8-b8d0-45bf7eedab13",
      "name": "Filterout the not required operations",
      "type": "n8n-nodes-base.filter",
      "position": [
        928,
        960
      ]
    },
    {
      "id": "ed6c6ff5-4a1e-424f-a59b-342eebd87872",
      "name": "Call subworkflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1232,
        960
      ]
    },
    {
      "id": "0d49f3cd-8a20-4bf9-aed3-89e5c6dec425",
      "name": "if operation is subtitles",
      "type": "n8n-nodes-base.if",
      "position": [
        432,
        1360
      ]
    },
    {
      "id": "5b245253-c587-4447-bc5c-bafa31db0859",
      "name": "Execute operation on the clip",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        704,
        1488
      ]
    },
    {
      "id": "d01f6482-6def-41e0-a772-19d2c3127fbe",
      "name": "Wait (according to how powerful your system is and how much ram you have)",
      "type": "n8n-nodes-base.wait",
      "position": [
        912,
        1488
      ]
    },
    {
      "id": "15905235-a21b-42bd-a5ff-6d1f0889bf15",
      "name": "find height & width",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        704,
        1232
      ]
    },
    {
      "id": "cd6c45fb-e6f0-458b-9e23-1eeb30171036",
      "name": "calculate relative subtitle size",
      "type": "n8n-nodes-base.code",
      "position": [
        912,
        1232
      ]
    },
    {
      "id": "e80d7716-e37f-4093-8226-73a49d34157c",
      "name": "burn subtitles",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        1104,
        1232
      ]
    },
    {
      "id": "c11721d5-b5c6-44f9-91dc-5a255d42a313",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1296,
        1232
      ]
    },
    {
      "id": "e681e63f-3b6d-4c35-8b5c-b7bc8c8b066c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        768
      ],
      "parameters": {
        "width": 2416,
        "height": 976,
        "content": "## Analysis of each clip and extracting required editing operations"
      }
    },
    {
      "id": "90d148db-9dae-4bb1-b664-460bb40da64b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        1408
      ],
      "parameters": {
        "width": 464,
        "height": 304,
        "content": "## Clipping out"
      }
    },
    {
      "id": "77f8d535-a391-4a85-8fab-6f724a9fd2cb",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        1200
      ],
      "parameters": {
        "width": 1728,
        "height": 512,
        "content": "## executing editing commands on the clips\nTake this into a seperate workflow, and configure the call sub-workflow node"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "EDITING": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Call subworkflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "burn subtitles": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "extract all clips paths",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "simple clipping (still in orignal aspect ratio)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call subworkflow": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Read clips from disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "if operation is subtitles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract filepath": {
      "main": [
        [
          {
            "node": "read srt from disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "formating of data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "formating of data": {
      "main": [
        [
          {
            "node": "some more formating",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "video download with yt-dlp",
            "type": "main",
            "index": 0
          },
          {
            "node": "get transcript from yt-dlp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "read srt from disk": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "find height & width": {
      "main": [
        [
          {
            "node": "calculate relative subtitle size",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "some more formating": {
      "main": [
        [
          {
            "node": "viral clips identification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read clips from disk": {
      "main": [
        [
          {
            "node": "extract clip file in base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract all clips paths": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if operation is subtitles": {
      "main": [
        [
          {
            "node": "find height & width",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Execute operation on the clip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get transcript from yt-dlp": {
      "main": [
        [
          {
            "node": "extract filepath",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "video download with yt-dlp": {
      "main": [
        [
          {
            "node": "get the downloaded video location",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "viral clips identification": {
      "main": [
        [
          {
            "node": "filter out top clips according to score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract clip file in base64": {
      "main": [
        [
          {
            "node": "convert base64 to actual binary file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute operation on the clip": {
      "main": [
        [
          {
            "node": "Wait (according to how powerful your system is and how much ram you have)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze the actual whole video": {
      "main": [
        [
          {
            "node": "extract all actionable operations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "seperate actionable data items": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "calculate relative subtitle size": {
      "main": [
        [
          {
            "node": "burn subtitles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract all actionable operations": {
      "main": [
        [
          {
            "node": "Filterout the not required operations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get the downloaded video location": {
      "main": [
        [
          {
            "node": "wait for both branches to complete and merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "video download with yt-dlp",
            "type": "main",
            "index": 0
          },
          {
            "node": "get transcript from yt-dlp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "convert base64 to actual binary file": {
      "main": [
        [
          {
            "node": "Analyze the actual whole video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filterout the not required operations": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter out top clips according to score": {
      "main": [
        [
          {
            "node": "wait for both branches to complete and merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "wait for both branches to complete and merge": {
      "main": [
        [
          {
            "node": "seperate actionable data items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "simple clipping (still in orignal aspect ratio)": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait (according to how powerful your system is and how much ram you have)": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}