{ "id": "TApiWf08LinkedIn01", "name": "Video → Transcript → LinkedIn Post (TranscriptAPI)", "nodes": [ { "parameters": {}, "id": "88888888-8888-4888-8888-888888888801", "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -160, 0 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "a8888888-8888-4888-8888-888888888aaa", "name": "videoUrl", "value": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "type": "string" } ] }, "options": {} }, "id": "88888888-8888-4888-8888-888888888802", "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": "88888888-8888-4888-8888-888888888803", "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 TranscriptAPI segments into plain text and carry the video title forward.\nconst data = $input.first().json;\nconst transcriptText = (data.transcript || []).map((s) => s.text).join(' ');\nconst meta = data.metadata || {};\nreturn [\n { json: { videoId: data.video_id, title: meta.title || null, author: meta.author_name || null, language: data.language || null, transcriptText } },\n];" }, "id": "88888888-8888-4888-8888-888888888804", "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 LinkedIn ghostwriter. Turn the video transcript into one ready-to-post LinkedIn post. Respond ONLY with a JSON object with keys: hook (a scroll-stopping first line), body (the main post in short punchy paragraphs separated by blank lines), cta (a closing call to action or question), hashtags (array of 3-5 strings, no # symbol), full_post (hook + body + cta + hashtags assembled and ready to paste). Be authentic and value-first, not salesy.' }, { role: 'user', content: 'Video title: ' + ($json.title || 'Untitled') + '\\n\\nTranscript:\\n' + $json.transcriptText } ] }) }}", "options": {} }, "id": "88888888-8888-4888-8888-888888888805", "name": "Write LinkedIn Post (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": "// Parse the LLM's JSON LinkedIn post into clean fields (graceful fallback).\nconst raw = ($json.choices && $json.choices[0] && $json.choices[0].message.content) || '';\nlet p; try { p = JSON.parse(raw); } catch (e) { p = { full_post: raw }; }\nconst src = $('Build Transcript Text').first().json;\nreturn [\n {\n json: {\n hook: p.hook || null,\n body: p.body || null,\n cta: p.cta || null,\n hashtags: p.hashtags || [],\n fullPost: p.full_post || '',\n sourceTitle: src.title,\n },\n },\n];" }, "id": "88888888-8888-4888-8888-888888888806", "name": "Format Post", "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 LinkedIn Post (LLM)", "type": "main", "index": 0 } ] ] }, "Write LinkedIn Post (LLM)": { "main": [ [ { "node": "Format Post", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "pinData": {} }