{
  "id": "qhQ58xkITiOaeCxg",
  "name": "YouTube Playlist Transcriber",
  "tags": [],
  "nodes": [
    {
      "id": "92bd0375-86bd-437a-814f-0c1b914b5b6e",
      "name": "Fetch Playlist",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        0
      ],
      "parameters": {
        "url": "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&maxResults=50&playlistId=REPLACE_WITH_PLAYLIST_ID&key=YOUR_TOKEN_HERE",
        "options": {}
      },
      "typeVersion": 4.1
    },
    {
      "id": "caa64cb8-35b1-4011-9aeb-207abb34a316",
      "name": "Extract Video IDs",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        0
      ],
      "parameters": {
        "jsCode": "const items = $json.items || [];\n\nreturn items.map(item => ({\n  json: {\n    video_id: item.snippet.resourceId.videoId,\n    title: item.snippet.title\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "21ff3195-912e-4580-ac31-f9711a26370e",
      "name": "Aggregate Transcripts",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        896,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "summarize",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "transcript",
              "aggregation": "append"
            }
          ]
        }
      },
      "typeVersion": 3
    },
    {
      "id": "7df3c2ae-8fb9-4aff-af57-b0ad79911fe9",
      "name": "Format Final Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        0
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nconst snippets = items\n  .flatMap(i => i.json.appended_transcript || [])\n  .flatMap(innerArray => innerArray)\n  .map(t => t.snippet)\n  .filter(Boolean);\n\nreturn [\n  {\n    json: {\n      snippets\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "16962fb9-f45d-47fb-9711-75eddee0c3a0",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1344,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "toJson"
      },
      "typeVersion": 1.1
    },
    {
      "id": "c1d033b0-5cf7-48bb-abe9-f39daa15a2c7",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1568,
        0
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "Attached is the compiled transcription report.",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        },
        "subject": "YouTube Playlist Transcripts"
      },
      "typeVersion": 2.2
    },
    {
      "id": "472c42de-cace-4078-a449-84a6da00a1c7",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f608a815-d90e-4375-979f-28c22d9226cb",
      "name": "Fetch Transcript via SerpApi",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        672,
        0
      ],
      "parameters": {
        "url": "=https://serpapi.com/search?engine=youtube_video_transcript&v={{ $json.video_id }}&type=asr&api_key=REPLACE_WITH_SERPAPI_KEY",
        "options": {}
      },
      "typeVersion": 4.4
    },
    {
      "id": "852dabed-4378-4905-b70e-7ef82b4035ad",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -80
      ],
      "parameters": {
        "color": 6,
        "height": 480,
        "content": "\nYouTube Playlist Transcriber\n\nThis workflow automatically:\n\n1. Fetches all videos from a YouTube playlist\n2. Retrieves transcripts using SerpAPI\n3. Normalizes transcript data\n4. Compiles a structured report\n5. Exports the results as a file\n6. Sends the report via email\n\n\nConfigure the following before running:\n\n1. YouTube Data API Key\n2. SerpAPI API Key\n3. Gmail credentials\n\nEnvironment Variables:\n\n- YOUTUBE_API_KEY\n- SERPAPI_API_KEY\n- PLAYLIST_ID\n"
      },
      "typeVersion": 1
    },
    {
      "id": "355a952f-ccf2-47a7-ad65-0508f921c82d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        432
      ],
      "parameters": {
        "width": 288,
        "height": 80,
        "content": "### How can we improve this workflow?\n### [>>> Share your feedback here](https://templates.app.n8n.cloud/form/dbf8d22e-4b05-4328-b164-dcc5555623e0)"
      },
      "typeVersion": 1
    },
    {
      "id": "d228e015-f823-4615-8fd4-90e27d35db5c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 832,
        "height": 208,
        "content": "Fetch Playlist transcribes from Yotube"
      },
      "typeVersion": 1
    },
    {
      "id": "b2cf2e7d-3739-403c-996d-00bf20a5b053",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -48
      ],
      "parameters": {
        "color": 7,
        "width": 880,
        "height": 208,
        "content": "Process transcriptions, convert to json and send to email"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "42e93250-b358-4d18-b888-f410a6393b62",
  "connections": {
    "Fetch Playlist": {
      "main": [
        [
          {
            "node": "Extract Video IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Fetch Playlist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Video IDs": {
      "main": [
        [
          {
            "node": "Fetch Transcript via SerpApi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Final Report": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Transcripts": {
      "main": [
        [
          {
            "node": "Format Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Transcript via SerpApi": {
      "main": [
        [
          {
            "node": "Aggregate Transcripts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}