{ "id": "TApiWf48AnalystArchiver01", "name": "Analyst Presentation Archiver (TranscriptAPI)", "nodes": [ { "parameters": {}, "id": "48484848-4848-4848-8848-484848484801", "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -340, 0 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "48484848-4848-4848-8848-4848484848a1", "name": "channel", "value": "REPLACE_WITH_IR_OR_RESEARCH_CHANNEL_HANDLE_OR_ID", "type": "string" } ] }, "options": {} }, "id": "48484848-4848-4848-8848-484848484802", "name": "Set Channel", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -120, 0 ] }, { "parameters": { "url": "https://transcriptapi.com/api/v2/youtube/channel/resolve", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "input", "value": "={{ $json.channel }}" } ] }, "options": {} }, "id": "48484848-4848-4848-8848-484848484803", "name": "Resolve Channel", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 100, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_TRANSCRIPTAPI_CRED_ID", "name": "TranscriptAPI - Authorization Bearer" } } }, { "parameters": { "url": "https://transcriptapi.com/api/v2/youtube/channel/videos", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "channel", "value": "={{ $json.channel_id }}" } ] }, "options": {} }, "id": "48484848-4848-4848-8848-484848484804", "name": "List Channel Videos", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 320, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_TRANSCRIPTAPI_CRED_ID", "name": "TranscriptAPI - Authorization Bearer" } } }, { "parameters": { "jsCode": "const data = $input.first().json;\nreturn (data.results || []).map((v) => ({ json: { videoId: v.videoId, videoTitle: v.title || null, videoUrl: 'https://www.youtube.com/watch?v=' + v.videoId } }));" }, "id": "48484848-4848-4848-8848-484848484805", "name": "Extract Video List", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 540, 0 ] }, { "parameters": { "maxItems": 5 }, "id": "48484848-4848-4848-8848-484848484806", "name": "Keep First 5", "type": "n8n-nodes-base.limit", "typeVersion": 1, "position": [ 760, 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": "48484848-4848-4848-8848-484848484807", "name": "Get Transcript (TranscriptAPI)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 980, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_TRANSCRIPTAPI_CRED_ID", "name": "TranscriptAPI - Authorization Bearer" } }, "onError": "continueRegularOutput" }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "const d = $json; const seg = Array.isArray(d.transcript) ? d.transcript : []; const meta = d.metadata || {};\nconst vid = d.video_id;\nconst transcriptText = seg.map((s) => s.text).join(' ');\nreturn { json: { title: meta.title || vid, videoUrl: 'https://www.youtube.com/watch?v=' + vid, transcriptApiUrl: 'https://transcriptapi.com/api/v2/youtube/transcript?video_url=https://www.youtube.com/watch?v=' + vid, transcriptText, hasTranscript: transcriptText.length > 0 } };" }, "id": "48484848-4848-4848-8848-484848484808", "name": "Build Presentation Input", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1200, 0 ] }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict" }, "conditions": [ { "id": "c4848484-4848-4848-8848-484848484ccc", "leftValue": "={{ $json.hasTranscript }}", "rightValue": true, "operator": { "type": "boolean", "operation": "true", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "id": "48484848-4848-4848-8848-484848484809", "name": "Has Transcript?", "type": "n8n-nodes-base.filter", "typeVersion": 2, "position": [ 1420, 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 archiving an analyst / investor presentation. From the transcript, respond with a JSON object with keys: company (or null), speaker (or null), event_type (e.g. earnings call, investor day, conference talk, or null), summary (3-4 sentences), key_statements (array of notable statements/figures stated), risks (array of risks or caveats mentioned). Use ONLY what is in the transcript; use null/empty when unknown and never invent figures.' }, { role: 'user', content: 'Title: ' + ($json.title || '') + '\\n\\nTranscript:\\n' + $json.transcriptText } ] }) }}", "options": {} }, "id": "48484848-4848-4848-8848-484848484810", "name": "Archive Fields (LLM)", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 1640, 0 ], "credentials": { "httpHeaderAuth": { "id": "REPLACE_OPENAI_CRED_ID", "name": "OpenAI - Authorization Bearer" } } }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "const raw = ($json.choices && $json.choices[0] && $json.choices[0].message.content) || '';\nlet a; try { a = JSON.parse(raw); } catch (e) { a = {}; }\nconst src = $('Build Presentation Input').item.json;\nreturn {\n json: {\n company: a.company || null,\n speaker: a.speaker || null,\n eventType: a.event_type || null,\n summary: a.summary || null,\n keyStatements: a.key_statements || [],\n risks: a.risks || [],\n title: src.title,\n videoUrl: src.videoUrl,\n transcriptApiUrl: src.transcriptApiUrl,\n },\n};" }, "id": "48484848-4848-4848-8848-484848484811", "name": "Format Archive Row", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1860, 0 ] } ], "connections": { "Start": { "main": [ [ { "node": "Set Channel", "type": "main", "index": 0 } ] ] }, "Set Channel": { "main": [ [ { "node": "Resolve Channel", "type": "main", "index": 0 } ] ] }, "Resolve Channel": { "main": [ [ { "node": "List Channel Videos", "type": "main", "index": 0 } ] ] }, "List Channel Videos": { "main": [ [ { "node": "Extract Video List", "type": "main", "index": 0 } ] ] }, "Extract Video List": { "main": [ [ { "node": "Keep First 5", "type": "main", "index": 0 } ] ] }, "Keep First 5": { "main": [ [ { "node": "Get Transcript (TranscriptAPI)", "type": "main", "index": 0 } ] ] }, "Get Transcript (TranscriptAPI)": { "main": [ [ { "node": "Build Presentation Input", "type": "main", "index": 0 } ] ] }, "Build Presentation Input": { "main": [ [ { "node": "Has Transcript?", "type": "main", "index": 0 } ] ] }, "Has Transcript?": { "main": [ [ { "node": "Archive Fields (LLM)", "type": "main", "index": 0 } ] ] }, "Archive Fields (LLM)": { "main": [ [ { "node": "Format Archive Row", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "pinData": {} }