{
  "nodes": [
    {
      "id": "06f890db-db93-44c0-8389-b73adaadd961",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1856,
        -256
      ],
      "parameters": {
        "width": 508,
        "height": 932,
        "content": "## Interview Clip Library Builder\n\nFor podcast producers, content teams, and video editors who want to automatically extract the best moments from interview recordings. Submit any interview URL with a descriptive query and this workflow uses WayinVideo AI to find the most relevant clips. Each clip is downloaded, uploaded to Google Drive, saved to a Google Sheet library, and a summary email is sent automatically.\n\n## How it works\n- **1. Form \u2014 Interview URL + Details** collects the recording URL, guest name, topic, moment query, and recipient email\n- **2. WayinVideo \u2014 Submit Find Moments** sends the video and query to WayinVideo Find Moments API\n- **3. Wait \u2014 90 Seconds** pauses to allow WayinVideo time to start processing\n- **4. WayinVideo \u2014 Get Clips Result** polls the API for the completed result\n- **5. IF \u2014 Status SUCCEEDED?** checks if processing is done \u2014 retries every 30 seconds if not\n- **7. Code \u2014 Split Each Clip** loops through all returned clips as individual items\n- **8. HTTP \u2014 Download Clip File** downloads each clip video file\n- **9. Google Drive \u2014 Upload Clip** uploads each clip to your Drive folder\n- **10. Google Sheets \u2014 Save to Library** saves clip metadata to your sheet\n- **11. Gmail \u2014 Send Summary Email** sends a confirmation email with links\n\n## Set up steps\n1. In **2. WayinVideo \u2014 Submit Find Moments** and **4. WayinVideo \u2014 Get Clips Result** \u2014 replace YOUR_WAYIN_API_KEY in each Authorization header\n2. In **9. Google Drive \u2014 Upload Clip** \u2014 replace YOUR_GDRIVE_FOLDER_ID and connect your Google Drive credential\n3. In **10. Google Sheets \u2014 Save to Library** \u2014 replace YOUR_GOOGLE_SHEET_ID and connect your Google Sheets credential\n4. In **11. Gmail \u2014 Send Summary Email** \u2014 connect your Gmail credential\n5. Create a Google Sheet tab named exactly: Interview Clip Library\n6. Activate the workflow and open the Form URL to test"
      },
      "typeVersion": 1
    },
    {
      "id": "5cb6346c-b2ae-48a1-864d-39c82d5971e6",
      "name": "Section \u2014 Form Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -112
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 200,
        "content": "## Form Input\nUser submits the interview recording URL, guest name, topic, moment query, and their email address. Submitting the form triggers the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "2e38c7cf-bcad-4519-9d7c-938dd9f30514",
      "name": "Section \u2014 WayinVideo Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -112
      ],
      "parameters": {
        "color": 6,
        "width": 852,
        "height": 420,
        "content": "## WayinVideo Processing\nSubmits the video and query to Find Moments API. Waits 90 seconds then polls for result. Retries every 30 seconds until status is SUCCEEDED."
      },
      "typeVersion": 1
    },
    {
      "id": "9443f083-3d12-4b28-a40f-54c6082fdda1",
      "name": "Section \u2014 Clip Download and Storage",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -96
      ],
      "parameters": {
        "color": 6,
        "width": 804,
        "height": 276,
        "content": "## Clip Download and Storage\nEach clip is split into individual items, downloaded from WayinVideo, uploaded to Google Drive, and metadata saved to the Google Sheet library."
      },
      "typeVersion": 1
    },
    {
      "id": "9a43b1dc-c3c3-4fd7-af05-57f9a6a53a4b",
      "name": "Section \u2014 Email Summary",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -96
      ],
      "parameters": {
        "color": 4,
        "width": 352,
        "height": 280,
        "content": "## Email Summary\nSends a confirmation email with a link to the original recording and instructions to check the Google Sheet for all Drive clip links."
      },
      "typeVersion": 1
    },
    {
      "id": "30c0ff40-3322-4d15-bb72-90dd2c253c07",
      "name": "Note \u2014 Use Descriptive Queries",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        368
      ],
      "parameters": {
        "color": 3,
        "width": 604,
        "height": 144,
        "content": "## \u26a0\ufe0f Use Descriptive Queries\nVague queries like 'tips' or 'advice' return empty results. Always use 4 to 6 descriptive words. Example: 'career advice and turning point moments' works. 'tips' does not."
      },
      "typeVersion": 1
    },
    {
      "id": "d6656f81-bae4-44b8-ac03-4dbb29d2abce",
      "name": "Note \u2014 Export Links Expire",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        256
      ],
      "parameters": {
        "color": 3,
        "width": 588,
        "height": 128,
        "content": "## \u26a0\ufe0f Export Links Expire in 24h\nWayinVideo export links expire 24 hours after generation. The download step must complete before expiry. Do not delay execution after clips are found."
      },
      "typeVersion": 1
    },
    {
      "id": "66fd7b61-ee75-43a0-a32b-39821c67d158",
      "name": "1. Form \u2014 Interview URL + Details",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1280,
        32
      ],
      "parameters": {
        "options": {},
        "formTitle": "\ud83c\udf99\ufe0f Interview Clip Library Builder",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Interview Recording URL",
              "placeholder": "https://zoom.us/rec/xxxxxxx or YouTube link",
              "requiredField": true
            },
            {
              "fieldLabel": "Guest Name",
              "placeholder": "e.g. Raj Sharma",
              "requiredField": true
            },
            {
              "fieldLabel": "Interview Topic / Category",
              "placeholder": "e.g. Digital Marketing, SEO, Career Growth",
              "requiredField": true
            },
            {
              "fieldLabel": "What Moments To Extract",
              "placeholder": "e.g. career advice and turning point moments (be descriptive!)",
              "requiredField": true
            },
            {
              "fieldLabel": "Send Email To",
              "placeholder": "user@example.com",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Paste your interview recording URL \u2014 AI will find the most relevant moments, upload them to Google Drive, and email you the links.\n\n\ud83d\udca1 Query Tips: Use descriptive phrases like 'career advice and lessons learned', 'success story and turning point', 'motivational moment', 'failure and comeback story'"
      },
      "typeVersion": 2.2
    },
    {
      "id": "f8b7e756-b654-489a-a576-70e707672472",
      "name": "2. WayinVideo \u2014 Submit Find Moments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        32
      ],
      "parameters": {
        "url": "https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"video_url\": \"{{ $json['Interview Recording URL'] }}\",\n  \"query\": \"{{ $json['What Moments To Extract'] }}\",\n  \"project_name\": \"{{ $json['Guest Name'] }} - {{ $json['Interview Topic / Category'] }}\",\n  \"limit\": 5,\n  \"enable_export\": true,\n  \"resolution\": \"HD_720\",\n  \"enable_caption\": true,\n  \"caption_display\": \"original\",\n  \"cc_style_tpl\": \"temp-7\",\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": "0673f6d2-0d3c-4f23-839f-9bec9f0e3a28",
      "name": "3. Wait \u2014 90 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        -800,
        32
      ],
      "parameters": {
        "amount": 90
      },
      "typeVersion": 1.1
    },
    {
      "id": "6699f49e-f4a2-4868-8ffe-4fa1f73fe045",
      "name": "4. WayinVideo \u2014 Get Clips Result",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -560,
        32
      ],
      "parameters": {
        "url": "=https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments/results/{{ $('2. WayinVideo \u2014 Submit Find Moments').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": "5a9fce81-4533-41f0-bda7-69b0b7e4484f",
      "name": "5. IF \u2014 Status SUCCEEDED?",
      "type": "n8n-nodes-base.if",
      "position": [
        -368,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cond-status-check",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.data.status }}",
              "rightValue": "SUCCEEDED"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "d54fecdd-6c60-476a-ad50-bd08a647f9ff",
      "name": "6. Wait \u2014 30 Seconds Retry",
      "type": "n8n-nodes-base.wait",
      "position": [
        -368,
        272
      ],
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "a21c7d8b-5fc1-4c53-a47c-3763a5402f36",
      "name": "7. Code \u2014 Split Each Clip",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        16
      ],
      "parameters": {
        "jsCode": "const clips = $json.data.clips || [];\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    idx: clip.idx\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "24b21cd7-7271-42af-81d5-b41d186392e2",
      "name": "8. HTTP \u2014 Download Clip File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        240,
        16
      ],
      "parameters": {
        "url": "={{ $json.export_link }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dce09d1b-cf47-445b-b8af-3ad56b4d5b2b",
      "name": "9. Google Drive \u2014 Upload Clip",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        448,
        16
      ],
      "parameters": {
        "name": "={{ $('1. Form \u2014 Interview URL + Details').item.json['Guest Name'].replace(/ /g,'_') + '_Clip_' + ($('7. Code \u2014 Split Each Clip').item.json.idx + 1) + '_Score_' + $('7. Code \u2014 Split Each Clip').item.json.score + '.mp4' }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GDRIVE_FOLDER_ID"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "464f750d-d932-4ebe-ae3a-ec36856e96a1",
      "name": "10. Google Sheets \u2014 Save to Library",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        656,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $now }}",
            "Tags": "={{ $('7. Code \u2014 Split Each Clip').item.json.tags.join(', ') }}",
            "Query": "={{ $('1. Form \u2014 Interview URL + Details').item.json['What Moments To Extract'] }}",
            "Score": "={{ $('7. Code \u2014 Split Each Clip').item.json.score }}",
            "Topic": "={{ $('1. Form \u2014 Interview URL + Details').item.json['Interview Topic / Category'] }}",
            "Timestamp": "={{ Math.floor($('7. Code \u2014 Split Each Clip').item.json.begin_ms/1000) }}s \u2014 {{ Math.floor($('7. Code \u2014 Split Each Clip').item.json.end_ms/1000) }}s",
            "Clip Title": "={{ $('7. Code \u2014 Split Each Clip').item.json.title }}",
            "Drive Link": "=https://drive.google.com/file/d/{{ $json.id }}/view",
            "Guest Name": "={{ $('1. Form \u2014 Interview URL + Details').item.json['Guest Name'] }}",
            "Description": "={{ $('7. Code \u2014 Split Each Clip').item.json.desc }}",
            "Drive File ID": "={{ $json.id }}",
            "Interview URL": "={{ $('1. Form \u2014 Interview URL + Details').item.json['Interview Recording URL'] }}"
          },
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Interview Clip Library"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "8cb8e1ed-038a-4979-9a0a-4cdde6e06a27",
      "name": "11. Gmail \u2014 Send Summary Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        960,
        16
      ],
      "parameters": {
        "sendTo": "={{ $('1. Form \u2014 Interview URL + Details').item.json['Send Email To'] }}",
        "message": "=<div style=\"font-family:Arial,sans-serif;max-width:600px;margin:0 auto;color:#222;\">\n<div style=\"background:#1a1a1a;padding:24px;text-align:center;\">\n  <h1 style=\"color:#fff;font-size:22px;margin:0;\">\ud83c\udf99\ufe0f Interview Clips Saved</h1>\n  <p style=\"color:#aaa;font-size:13px;margin:8px 0 0;\">{{ $('1. Form \u2014 Interview URL + Details').item.json['Guest Name'] }} \u2014 {{ $('1. Form \u2014 Interview URL + Details').item.json['Interview Topic / Category'] }}</p>\n</div>\n<div style=\"padding:24px;\">\n  <p>Hi,</p>\n  <p>Your interview clips have been <strong>uploaded to Google Drive</strong> and saved to the Interview Clip Library.</p>\n  <p><strong>Query Used:</strong> {{ $('1. Form \u2014 Interview URL + Details').item.json['What Moments To Extract'] }}</p>\n  <p><strong>Full Recording:</strong> <a href=\"{{ $('1. Form \u2014 Interview URL + Details').item.json['Interview Recording URL'] }}\" style=\"color:#1a1a1a;\">View Original Interview</a></p>\n  <p style=\"font-size:13px;color:#555;\">Open your <strong>Interview Clip Library</strong> Google Sheet to access all clip Drive links.</p>\n</div>\n<div style=\"padding:16px 24px;background:#f9f9f9;\">\n  <p style=\"font-size:12px;color:#999;margin:0;\">Powered by WayinVideo Find Moments API</p>\n</div>\n</div>",
        "options": {},
        "subject": "=\ud83c\udf99\ufe0f Interview Clips Saved to Drive \u2014 {{ $('1. Form \u2014 Interview URL + Details').item.json['Guest Name'] }}"
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "3. Wait \u2014 90 Seconds": {
      "main": [
        [
          {
            "node": "4. WayinVideo \u2014 Get Clips Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5. IF \u2014 Status SUCCEEDED?": {
      "main": [
        [
          {
            "node": "7. Code \u2014 Split Each Clip",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "6. Wait \u2014 30 Seconds Retry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7. Code \u2014 Split Each Clip": {
      "main": [
        [
          {
            "node": "8. HTTP \u2014 Download Clip File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6. Wait \u2014 30 Seconds Retry": {
      "main": [
        [
          {
            "node": "4. WayinVideo \u2014 Get Clips Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8. HTTP \u2014 Download Clip File": {
      "main": [
        [
          {
            "node": "9. Google Drive \u2014 Upload Clip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9. Google Drive \u2014 Upload Clip": {
      "main": [
        [
          {
            "node": "10. Google Sheets \u2014 Save to Library",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. WayinVideo \u2014 Get Clips Result": {
      "main": [
        [
          {
            "node": "5. IF \u2014 Status SUCCEEDED?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Form \u2014 Interview URL + Details": {
      "main": [
        [
          {
            "node": "2. WayinVideo \u2014 Submit Find Moments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "10. Google Sheets \u2014 Save to Library": {
      "main": [
        [
          {
            "node": "11. Gmail \u2014 Send Summary Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. WayinVideo \u2014 Submit Find Moments": {
      "main": [
        [
          {
            "node": "3. Wait \u2014 90 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}