{
  "name": "Convert Reddit threads into short vertical videos with AI",
  "nodes": [
    {
      "id": "c82ef841-c864-4980-9319-6e2e0a7985ce",
      "name": "Split Clips",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        -2720,
        1100
      ]
    },
    {
      "id": "7e329005-5824-4818-878a-ec5ab97031dc",
      "name": "Pexels Query",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2020,
        880
      ]
    },
    {
      "id": "618a6bf4-31ec-4f4b-ad02-1fd0bd9b5565",
      "name": "OpenAI (ChatGPT)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -3080,
        1100
      ]
    },
    {
      "id": "f364947c-6b24-4bd3-ad9d-009f2990d04a",
      "name": "Get video urls",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -940,
        880
      ]
    },
    {
      "id": "4e1467f2-2798-4bd3-a339-9063bab63e42",
      "name": "Extract 3 videos per item",
      "type": "n8n-nodes-base.code",
      "position": [
        -1760,
        880
      ]
    },
    {
      "id": "6129fe06-3b3b-42dd-8247-509f155eb974",
      "name": "Combine 3 into 1",
      "type": "n8n-nodes-base.code",
      "position": [
        -620,
        880
      ]
    },
    {
      "id": "b81b9351-19d8-429e-af0f-34dbd093aeb9",
      "name": "get reddit token",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -4380,
        880
      ]
    },
    {
      "id": "ece8f40e-318e-4d76-b237-1b26545c8e9c",
      "name": "get reddit thread",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3800,
        980
      ]
    },
    {
      "id": "ee6cd394-6714-4ae5-88c7-36950915a0b4",
      "name": "create timeline with video",
      "type": "n8n-nodes-base.code",
      "position": [
        100,
        1100
      ]
    },
    {
      "id": "f488889c-c7c1-4f11-9101-124a46943534",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2060,
        780
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "68e0f4de-c7cd-4c95-b864-216e8451ee16",
      "name": "Merge media, audio and subtitles",
      "type": "n8n-nodes-base.merge",
      "position": [
        -100,
        1100
      ]
    },
    {
      "id": "7daba492-81a4-4f21-a521-34b482d52272",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -4800,
        1160
      ]
    },
    {
      "id": "b16d8e2f-d0c1-4822-83cd-569dbfd60d01",
      "name": "Split Out TTS settings",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -4380,
        1440
      ]
    },
    {
      "id": "6b018650-f54b-4bcb-b927-971221e280e5",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -2240,
        1420
      ]
    },
    {
      "id": "e4818147-e130-43ea-800d-a2ac42c40324",
      "name": "Split Out redditLink",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -4380,
        1080
      ]
    },
    {
      "id": "9d1aa00d-31fd-4137-b788-64d48427e8e0",
      "name": "Convert url to reddit api url",
      "type": "n8n-nodes-base.code",
      "position": [
        -4180,
        1080
      ]
    },
    {
      "id": "9d0d572c-c3db-40f3-996e-c248e2b98bc5",
      "name": "combine token and url",
      "type": "n8n-nodes-base.merge",
      "position": [
        -3980,
        980
      ]
    },
    {
      "id": "b9498f9c-d3ea-4136-84e4-051ee823204a",
      "name": "Split Out videoLength",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -4380,
        1260
      ]
    },
    {
      "id": "e47fb3b0-e092-426a-9cb0-fad609097515",
      "name": "Merge length and reddit json",
      "type": "n8n-nodes-base.merge",
      "position": [
        -3520,
        1100
      ]
    },
    {
      "id": "4d417707-6153-451b-8cb4-e55b219272dd",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        800,
        1220
      ]
    },
    {
      "id": "05621977-50bc-4008-a58c-551b119326a2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2060,
        1080
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "24b67449-d896-4a66-ab9b-18cbda213f61",
      "name": "extract text field",
      "type": "n8n-nodes-base.code",
      "position": [
        -1340,
        1100
      ]
    },
    {
      "id": "6d9334d4-547d-4bc5-99fe-fb56ebe6845f",
      "name": "Merge clips and TTS settings",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2420,
        1420
      ]
    },
    {
      "id": "4c58be43-96d0-4d5c-b3df-f0d774a35c64",
      "name": "If Status=Ready then continue",
      "type": "n8n-nodes-base.if",
      "position": [
        -800,
        1320
      ]
    },
    {
      "id": "615d4153-2cea-467e-9867-af6448d298ca",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2060,
        1240
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f8efb701-d8ae-4c71-a3af-c95f83743739",
      "name": "Generate TTS",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -2040,
        1420
      ]
    },
    {
      "id": "70dde8c7-53d9-4e01-a470-a8778c5224cf",
      "name": "Rename Keys",
      "type": "n8n-nodes-base.renameKeys",
      "position": [
        -620,
        1300
      ]
    },
    {
      "id": "2dd7c499-6cae-414d-9d2c-3eb36b396ebb",
      "name": "Wait for inputs",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1300,
        1320
      ]
    },
    {
      "id": "3face551-4170-4370-b476-ee88cafaba43",
      "name": "Merge upload links and TTS audio",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1660,
        1400
      ]
    },
    {
      "id": "a0d13f64-c61d-409b-958e-c6d60028b467",
      "name": "Get audio URLs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        1320
      ]
    },
    {
      "id": "70b15057-d0a7-4a1a-9921-916c231c27cd",
      "name": "Get upload links",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1860,
        1300
      ]
    },
    {
      "id": "2b2e26cc-bed5-4ead-9327-8b1674031541",
      "name": "Upload TTS to Shotstack",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1460,
        1400
      ]
    },
    {
      "id": "b2631555-e873-4ea1-a951-5001f7bbad09",
      "name": "Upload videos to ShotStack",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1500,
        880
      ]
    },
    {
      "id": "6b429842-ca6d-4d3e-a068-8bfe976cb5e8",
      "name": "Wait 10s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1200,
        880
      ]
    },
    {
      "id": "4155cf71-654c-427b-90ec-6c044b5c37cb",
      "name": "Wait 15s",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1120,
        1320
      ]
    },
    {
      "id": "92fe5007-125b-4283-bcd8-0b29e518bf72",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -4800,
        1380
      ]
    },
    {
      "id": "93a5d875-8fe8-4933-a72c-42b1b7432ad1",
      "name": "Limit comments length",
      "type": "n8n-nodes-base.code",
      "position": [
        -3280,
        1100
      ]
    },
    {
      "id": "1d0aac60-8b34-4c8f-b1ca-fec9c0ce4ed3",
      "name": "Merge timeline and HTTP req",
      "type": "n8n-nodes-base.merge",
      "position": [
        540,
        1220
      ]
    },
    {
      "id": "4fec0793-bcfb-4a44-a4f6-7a01ed55a654",
      "name": "Render the video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        300,
        1000
      ]
    },
    {
      "id": "9100ba52-a06b-4979-9d24-419b0c2f8a82",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        560,
        920
      ]
    },
    {
      "id": "175c2522-b666-48b2-bb68-2ab3fd866923",
      "name": "Get video link",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        780,
        920
      ]
    },
    {
      "id": "ddeca417-8dbe-4beb-b22d-a18674793329",
      "name": "If rendered",
      "type": "n8n-nodes-base.if",
      "position": [
        980,
        920
      ]
    },
    {
      "id": "0280d3cf-b162-4a0b-a599-de041c245154",
      "name": "Get the URL",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        900
      ]
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Generate TTS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get video link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Split Out TTS settings",
            "type": "main",
            "index": 0
          },
          {
            "node": "get reddit token",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out videoLength",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out redditLink",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10s": {
      "main": [
        [
          {
            "node": "Get video urls",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 15s": {
      "main": [
        [
          {
            "node": "Get audio URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If rendered": {
      "main": [
        [
          {
            "node": "Get the URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rename Keys": {
      "main": [
        [
          {
            "node": "Merge media, audio and subtitles",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Split Clips": {
      "main": [
        [
          {
            "node": "extract text field",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge clips and TTS settings",
            "type": "main",
            "index": 0
          },
          {
            "node": "Pexels Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate TTS": {
      "main": [
        [
          {
            "node": "Merge upload links and TTS audio",
            "type": "main",
            "index": 1
          },
          {
            "node": "Get upload links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pexels Query": {
      "main": [
        [
          {
            "node": "Extract 3 videos per item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get audio URLs": {
      "main": [
        [
          {
            "node": "If Status=Ready then continue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get video link": {
      "main": [
        [
          {
            "node": "If rendered",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get video urls": {
      "main": [
        [
          {
            "node": "Combine 3 into 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for inputs": {
      "main": [
        [
          {
            "node": "Wait 15s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine 3 into 1": {
      "main": [
        [
          {
            "node": "Merge media, audio and subtitles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get upload links": {
      "main": [
        [
          {
            "node": "Merge upload links and TTS audio",
            "type": "main",
            "index": 0
          },
          {
            "node": "Wait for inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI (ChatGPT)": {
      "main": [
        [
          {
            "node": "Split Clips",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render the video": {
      "main": [
        [
          {
            "node": "Merge timeline and HTTP req",
            "type": "main",
            "index": 0
          },
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get reddit token": {
      "main": [
        [
          {
            "node": "combine token and url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get reddit thread": {
      "main": [
        [
          {
            "node": "Merge length and reddit json",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract text field": {
      "main": [
        [
          {
            "node": "Merge media, audio and subtitles",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Out redditLink": {
      "main": [
        [
          {
            "node": "Convert url to reddit api url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit comments length": {
      "main": [
        [
          {
            "node": "OpenAI (ChatGPT)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out videoLength": {
      "main": [
        [
          {
            "node": "Merge length and reddit json",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "combine token and url": {
      "main": [
        [
          {
            "node": "get reddit thread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out TTS settings": {
      "main": [
        [
          {
            "node": "Merge clips and TTS settings",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload TTS to Shotstack": {
      "main": [
        [
          {
            "node": "Wait for inputs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract 3 videos per item": {
      "main": [
        [
          {
            "node": "Upload videos to ShotStack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload videos to ShotStack": {
      "main": [
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create timeline with video": {
      "main": [
        [
          {
            "node": "Render the video",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge timeline and HTTP req",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge timeline and HTTP req": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge clips and TTS settings": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge length and reddit json": {
      "main": [
        [
          {
            "node": "Limit comments length",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert url to reddit api url": {
      "main": [
        [
          {
            "node": "combine token and url",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "If Status=Ready then continue": {
      "main": [
        [
          {
            "node": "Rename Keys",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 15s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge media, audio and subtitles": {
      "main": [
        [
          {
            "node": "create timeline with video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge upload links and TTS audio": {
      "main": [
        [
          {
            "node": "Upload TTS to Shotstack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "get reddit token",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out redditLink",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out videoLength",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out TTS settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}