{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "b05002e2-72ed-40d4-b58e-f2a6691e3951",
      "name": "Main \u2014 Overview & Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        448
      ],
      "parameters": {
        "width": 400,
        "height": 668,
        "content": "## Webinar Recording \u2192 Lead Nurture Clips\n\n### How it works\nThis workflow accepts a webinar recording URL via a hosted form and submits it to the WayinVideo AI API to extract the most engaging clip segments. It polls every 45 seconds until the clips are ready, then downloads each clip file and uploads it directly to a Google Drive folder \u2014 ready to use in email lead nurture sequences.\n\n### Setup\n1. Replace `YOUR_WAYINVIDEO_API_KEY` in nodes **2** and **4** with your WayinVideo bearer token\n2. Create a **Google Drive OAuth2** credential in n8n and connect it to node **8**\n3. Replace `YOUR_GOOGLE_DRIVE_FOLDER_ID` in node **8** with your target Drive folder ID\n4. Activate the workflow and open the form URL to submit your first webinar recording\n\n### Customization Tips\n- Change `target_duration` to `DURATION_15_30` for shorter social media clips\n- Set `enable_ai_reframe` to `true` for vertical/mobile-optimized output\n- Add a Gmail or Mailchimp node after node 8 to automatically email clip links to leads"
      },
      "typeVersion": 1
    },
    {
      "id": "d5c3252e-df14-4a47-8567-7d7fcd0d95d9",
      "name": "Section \u2014 Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        544
      ],
      "parameters": {
        "color": 5,
        "width": 250,
        "height": 100,
        "content": "## \ud83d\udce5 Section 1 \u2014 Input\nCollects the webinar recording URL, topic, brand name, and max clip count via a hosted n8n form."
      },
      "typeVersion": 1
    },
    {
      "id": "c12b1c88-3dde-4712-97d6-7f00bc792769",
      "name": "Section \u2014 Submit & Wait",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        544
      ],
      "parameters": {
        "color": 5,
        "width": 510,
        "height": 100,
        "content": "## \ud83d\ude80 Section 2 \u2014 Submit & Wait\nSends the clipping job to the WayinVideo API, then waits 45 seconds before the first result check."
      },
      "typeVersion": 1
    },
    {
      "id": "b20003ec-269e-4884-91dc-beadfb80399e",
      "name": "Section \u2014 Poll Results",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        544
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 100,
        "content": "## \ud83d\udd04 Section 3 \u2014 Poll for Results\nChecks whether clips are ready. If not, loops back to the Wait node and retries every 45 seconds."
      },
      "typeVersion": 1
    },
    {
      "id": "d3903e5f-1f7c-4efb-b33c-e64bdd061b30",
      "name": "Section \u2014 Extract & Upload",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        544
      ],
      "parameters": {
        "color": 5,
        "width": 686,
        "height": 100,
        "content": "## \ud83d\udce4 Section 4 \u2014 Extract, Download & Upload\nSplits the clips array, downloads each video file, and uploads it to the configured Google Drive folder."
      },
      "typeVersion": 1
    },
    {
      "id": "41cf6e38-3d55-42f6-abf9-c4aca40ebba9",
      "name": "Warning \u2014 Infinite Loop Risk",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        912
      ],
      "parameters": {
        "color": 3,
        "width": 668,
        "height": 124,
        "content": "## \u26a0\ufe0f WARNING \u2014 Infinite Polling Loop Risk\nIf WayinVideo never returns a completed result (e.g. invalid URL, unsupported format, API error), this workflow will loop indefinitely and consume execution credits. Add a retry counter using a Set node + a second If node to cap retries at 10\u201315 attempts maximum."
      },
      "typeVersion": 1
    },
    {
      "id": "0af12ec2-50d8-4b10-9090-d76d079dd4c1",
      "name": "3. Wait \u2014 45 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        1184,
        688
      ],
      "parameters": {
        "amount": 45
      },
      "typeVersion": 1.1
    },
    {
      "id": "52d9ccb7-cd98-4c78-9dc5-d8f008a64a5b",
      "name": "4. WayinVideo \u2014 Poll Clip Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1424,
        688
      ],
      "parameters": {
        "url": "=https://wayinvideo-api.wayin.ai/api/v2/clips/results/{{ $('2. WayinVideo \u2014 Submit Clipping Task1').item.json.data.id }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            },
            {
              "name": "x-wayinvideo-api-version",
              "value": "v2"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "aabf29fa-38a1-4fe0-9fe8-77212c02aa59",
      "name": "5. If \u2014 Clips Ready Check",
      "type": "n8n-nodes-base.if",
      "position": [
        1632,
        688
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bb411b2c-d05a-4671-a590-29b2f4eb2483",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "77329a4d-bdc3-4f13-8f50-26fab670ee42",
      "name": "7. HTTP \u2014 Download Clip File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2160,
        672
      ],
      "parameters": {
        "url": "={{ $json.export_link }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "8f0c9bda-7196-451c-bad0-8fdd4342469e",
      "name": "2. WayinVideo \u2014 Submit Clipping Task1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        944,
        688
      ],
      "parameters": {
        "url": "https://wayinvideo-api.wayin.ai/api/v2/clips",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_url\": \"{{ $json['Webinar Recording URL'] }}\",\n  \"project_name\": \"{{ $json['Webinar Topic / Title'] }}\",\n  \"target_duration\": \"DURATION_30_60\",\n  \"limit\": {{ $json['Max Clips to Generate'] }},\n  \"enable_export\": true,\n  \"resolution\": \"HD_720\",\n  \"enable_caption\": true,\n  \"enable_ai_reframe\": false,\n  \"target_lang\": \"en\"\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            },
            {
              "name": "x-wayinvideo-api-version",
              "value": "v2"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9626617d-9e74-498b-bcbf-d76e109aa561",
      "name": "6. Code \u2014 Extract Clips Array1",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        672
      ],
      "parameters": {
        "jsCode": "const clips = $json.data.clips;\n\nreturn clips.map(clip => ({\n  json: {\n    title: clip.title,\n    export_link: clip.export_link,\n    score: clip.score,\n    tags: clip.tags,\n    desc: clip.desc,\n    begin_ms: clip.begin_ms,\n    end_ms: clip.end_ms\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "8868b4c9-f941-434d-9111-563089378c18",
      "name": "8. Google Drive \u2014 Upload Clip1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2400,
        672
      ],
      "parameters": {
        "name": "={{ $('6. Code \u2014 Extract Clips Array1').item.json.title }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "cachedResultName": "YOUR_FOLDER_NAME"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "4aa811a8-9b2b-45c8-9a71-07db692320fb",
      "name": "1. Form \u2014 Webinar URL + Details",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        672,
        688
      ],
      "parameters": {
        "options": {},
        "formTitle": "\ud83c\udfaf Webinar Recording to Lead Nurture Clips",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Webinar Recording URL",
              "placeholder": "https://zoom.us/rec/xxxxxxx",
              "requiredField": true
            },
            {
              "fieldLabel": "Webinar Topic / Title",
              "placeholder": "e.g. How to 10x Leads with SEO",
              "requiredField": true
            },
            {
              "fieldLabel": "Company / Brand Name",
              "placeholder": "e.g. Incrementors",
              "requiredField": true
            },
            {
              "fieldLabel": "Max Clips to Generate",
              "placeholder": "e.g. 5",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Paste your webinar recording URL \u2014 AI will extract the top engaging clips ready for your email lead nurture sequence."
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "3. Wait \u2014 45 Seconds": {
      "main": [
        [
          {
            "node": "4. WayinVideo \u2014 Poll Clip Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5. If \u2014 Clips Ready Check": {
      "main": [
        [
          {
            "node": "6. Code \u2014 Extract Clips Array1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "3. Wait \u2014 45 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7. HTTP \u2014 Download Clip File": {
      "main": [
        [
          {
            "node": "8. Google Drive \u2014 Upload Clip1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6. Code \u2014 Extract Clips Array1": {
      "main": [
        [
          {
            "node": "7. HTTP \u2014 Download Clip File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Form \u2014 Webinar URL + Details": {
      "main": [
        [
          {
            "node": "2. WayinVideo \u2014 Submit Clipping Task1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. WayinVideo \u2014 Poll Clip Results": {
      "main": [
        [
          {
            "node": "5. If \u2014 Clips Ready Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. WayinVideo \u2014 Submit Clipping Task1": {
      "main": [
        [
          {
            "node": "3. Wait \u2014 45 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}