{ "id": "TApiWf14ShowNotes01", "name": "Video → Transcript → Podcast Show Notes + Chapters (TranscriptAPI)", "nodes": [ { "parameters": {}, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee01", "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -160, 0 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeaa", "name": "videoUrl", "value": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "type": "string" } ] }, "options": {} }, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee02", "name": "Set Video URL", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 60, 0 ] }, { "parameters": { "url": "https://transcriptapi.com/api/v2/youtube/transcript", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "video_url", "value": "={{ $json.videoUrl }}" }, { "name": "format", "value": "json" }, { "name": "send_metadata", "value": "true" } ] }, "options": {} }, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee03", "name": "Get Transcript (TranscriptAPI)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 280, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_TRANSCRIPTAPI_CRED_ID", "name": "TranscriptAPI - Authorization Bearer" } } }, { "parameters": { "jsCode": "// Join transcript segments with timestamps so the LLM can cite exact times.\nconst data = $input.first().json;\nconst meta = data.metadata || {};\nfunction ts(sec) {\n const s = Math.floor(sec || 0);\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const r = s % 60;\n const mm = (r < 10 ? '0' : '') + r;\n if (h > 0) return h + ':' + (m < 10 ? '0' : '') + m + ':' + mm;\n return m + ':' + mm;\n}\nconst lines = (data.transcript || []).map((seg) => '[' + ts(seg.start) + '] ' + seg.text);\nreturn [\n { json: { videoId: data.video_id, title: meta.title || null, language: data.language || null, transcriptText: lines.join('\\n') } },\n];" }, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee04", "name": "Build Transcript Text", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 500, 0 ] }, { "parameters": { "method": "POST", "url": "https://api.openai.com/v1/chat/completions", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ model: 'gpt-4o-mini', response_format: { type: 'json_object' }, messages: [ { role: 'system', content: 'You are a podcast producer. Using the timestamped transcript, produce show notes. Respond ONLY with a JSON object with keys: summary (2-3 sentences), chapters (array of objects each with timestamp (e.g. \"0:00\", \"4:30\") and title (short chapter title); the FIRST chapter MUST start at 0:00), show_notes (a Markdown document with the summary, a Chapters list, and 3-6 Key Points bullets).' }, { role: 'user', content: 'Video title: ' + ($json.title || 'Untitled') + '\\n\\nTimestamped transcript:\\n' + $json.transcriptText } ] }) }}", "options": {} }, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee05", "name": "Write Show Notes (LLM)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 720, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_OPENAI_CRED_ID", "name": "OpenAI - Authorization Bearer" } } }, { "parameters": { "jsCode": "const raw = ($json.choices && $json.choices[0] && $json.choices[0].message.content) || '';\nlet r; try { r = JSON.parse(raw); } catch (e) { r = {}; }\nconst chapters = Array.isArray(r.chapters) ? r.chapters : [];\nconst chapterMarkers = chapters.map((c) => (c.timestamp || '0:00') + ' ' + (c.title || '')).join('\\n');\nconst src = $('Build Transcript Text').first().json;\nreturn [\n {\n json: {\n summary: r.summary || null,\n chapters,\n chapterMarkers,\n showNotes: r.show_notes || '',\n sourceTitle: src.title,\n },\n },\n];" }, "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeee06", "name": "Format Show Notes", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 940, 0 ] } ], "connections": { "Start": { "main": [ [ { "node": "Set Video URL", "type": "main", "index": 0 } ] ] }, "Set Video URL": { "main": [ [ { "node": "Get Transcript (TranscriptAPI)", "type": "main", "index": 0 } ] ] }, "Get Transcript (TranscriptAPI)": { "main": [ [ { "node": "Build Transcript Text", "type": "main", "index": 0 } ] ] }, "Build Transcript Text": { "main": [ [ { "node": "Write Show Notes (LLM)", "type": "main", "index": 0 } ] ] }, "Write Show Notes (LLM)": { "main": [ [ { "node": "Format Show Notes", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "pinData": {} }