{
  "id": "y7hQeDrKG6Dh0GRo",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "The Recap AI - YouTube Video Clipper",
  "tags": [],
  "nodes": [
    {
      "id": "8ec0c272-cdd2-4398-8799-035b4e9cbb57",
      "name": "form_trigger",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -180,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "YouTube Video Clipper",
        "formFields": {
          "values": [
            {
              "fieldLabel": "YouTube Video Url",
              "placeholder": "https://www.youtube.com/watch?v=DB9mjd-65gw",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2ab8e9a6-6a75-40c9-9f9c-3512fa1208af",
      "name": "submit_video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        100,
        0
      ],
      "parameters": {
        "url": "https://elb-api.vizard.ai/hvizard-server-front/open-api/v1/project/create",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"lang\": \"en\",\n  \"preferLength\": [\n    0\n  ],\n  \"videoUrl\": \"{{ $json['YouTube Video Url'] }}\",\n  \"videoType\": 2,\n  \"maxClipNumber\": 8\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cfddcedd-19ab-45a2-b746-657c580082b2",
      "name": "wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        380,
        0
      ],
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "42c02942-9d9e-42e0-b931-cf3feb354394",
      "name": "check_status",
      "type": "n8n-nodes-base.if",
      "position": [
        940,
        100
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0583b406-8a93-4582-9229-7f68aa461320",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ $json.code }}",
              "rightValue": 2000
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "01e39b0c-8226-4f1d-a6c4-eb2826219859",
      "name": "send_initial_msg",
      "type": "n8n-nodes-base.slack",
      "position": [
        -180,
        560
      ],
      "parameters": {
        "text": "=<{{ $('form_trigger').item.json['YouTube Video Url'] }}|Video Clipper Results>",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C08KC39K8DR",
          "cachedResultName": "ai-tools-content"
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "72cf4174-306f-4ed9-8b94-1ec43209a84b",
      "name": "set_videos",
      "type": "n8n-nodes-base.set",
      "position": [
        100,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "dd18de51-6e46-48a5-8df6-3fbb6b03474b",
              "name": "videos",
              "type": "array",
              "value": "={{ $('check_status').item.json.videos }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "985bc5e1-00f3-4023-a6e0-a98c9ad025d9",
      "name": "get_clipping_status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        660,
        0
      ],
      "parameters": {
        "url": "=https://elb-api.vizard.ai/hvizard-server-front/open-api/v1/project/query/{{ $json.projectId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "72bd9d52-762a-4f46-861a-461bddaae842",
      "name": "split_videos",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        380,
        560
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "videos"
      },
      "typeVersion": 1
    },
    {
      "id": "17d6d975-63f3-452d-9ddc-952ff97d9600",
      "name": "send_video_msg",
      "type": "n8n-nodes-base.slack",
      "position": [
        940,
        560
      ],
      "parameters": {
        "text": "=*{{ $json.title }} | ({{ $json.viralScore }} / 10)*\n```\n{{ $json.videoUrl }}\n```\n---",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C08KC39K8DR",
          "cachedResultName": "ai-tools-content"
        },
        "otherOptions": {
          "thread_ts": {
            "replyValues": {
              "thread_ts": "={{ $('send_initial_msg').item.json.message.ts }}"
            }
          },
          "includeLinkToWorkflow": false
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "800c0992-1bc3-4b9e-9328-459290f465b0",
      "name": "filter_viral_score",
      "type": "n8n-nodes-base.filter",
      "position": [
        660,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1ca8f8e1-04f4-44fd-9a2d-7e656b08ff81",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.viralScore }}",
              "rightValue": 9
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "115d57c2-5326-4e9d-b1f6-5ab50a6a74aa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -200
      ],
      "parameters": {
        "color": 5,
        "width": 1380,
        "height": 560,
        "content": "## 1. Analyze Long Form YouTube Video & Generate Viral Clips\n- Provide YouTube Video Urls as Input\n- Send API request to Vizard AI to submit the video to analyze and generate the clips\n- Poll the Vizard `/query` endpoint"
      },
      "typeVersion": 1
    },
    {
      "id": "84f43084-3d5d-4af1-b191-ac6b95ab00e7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        380
      ],
      "parameters": {
        "color": 6,
        "width": 1380,
        "height": 360,
        "content": "## 2. Share Best Viral Clips In Slack\n- Filter video clip results that have a viral score of at least 9 out of 10\n- Share video title and link to download in slack thread for further review\n- This can be extended even further to auto-generate captions using a LLM and auto-posting to social media channels via blotato"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "117cda19-70c4-426a-a9a5-04a0d6034916",
  "connections": {
    "wait": {
      "main": [
        [
          {
            "node": "get_clipping_status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set_videos": {
      "main": [
        [
          {
            "node": "split_videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "check_status": {
      "main": [
        [
          {
            "node": "send_initial_msg",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "form_trigger": {
      "main": [
        [
          {
            "node": "submit_video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "split_videos": {
      "main": [
        [
          {
            "node": "filter_viral_score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "submit_video": {
      "main": [
        [
          {
            "node": "wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "send_initial_msg": {
      "main": [
        [
          {
            "node": "set_videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter_viral_score": {
      "main": [
        [
          {
            "node": "send_video_msg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_clipping_status": {
      "main": [
        [
          {
            "node": "check_status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}