{ "id": "TApiWf03Blog01", "name": "Single Video → Transcript → SEO Blog-Post Draft (TranscriptAPI)", "nodes": [ { "parameters": {}, "id": "33333333-3333-4333-8333-333333333301", "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -160, 0 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "a3333333-3333-4333-8333-3333333333aa", "name": "videoUrl", "value": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "type": "string" } ] }, "options": {} }, "id": "33333333-3333-4333-8333-333333333302", "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": "33333333-3333-4333-8333-333333333303", "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 one plain-text transcript and carry\n// the video metadata (title/author/thumbnail) forward for the blog draft.\nconst data = $input.first().json;\nconst transcriptText = (data.transcript || []).map((s) => s.text).join(' ');\nconst meta = data.metadata || {};\nreturn [\n {\n json: {\n videoId: data.video_id,\n title: meta.title || null,\n author: meta.author_name || null,\n thumbnail: meta.thumbnail_url || null,\n language: data.language || null,\n transcriptText,\n },\n },\n];" }, "id": "33333333-3333-4333-8333-333333333304", "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 an expert SEO content writer. Turn the YouTube video transcript into a publish-ready blog post draft. Respond ONLY with a JSON object with these keys: seo_title (string, max 60 chars), meta_description (string, max 155 chars), slug (kebab-case string), tags (array of 5 short strings), markdown (the full article in Markdown: an engaging intro, 3-6 sections with ## and ### headings, and a conclusion). Write clear, original prose; do not copy the transcript verbatim.' }, { role: 'user', content: 'Video title: ' + ($json.title || 'Untitled') + '\\n\\nTranscript:\\n' + $json.transcriptText } ] }) }}", "options": {} }, "id": "33333333-3333-4333-8333-333333333305", "name": "Generate Blog Draft (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 blog draft into clean fields. Falls back to raw text if parsing fails.\nconst raw = ($json.choices && $json.choices[0] && $json.choices[0].message.content) || '';\nlet draft;\ntry { draft = JSON.parse(raw); } catch (e) { draft = { markdown: raw }; }\nconst src = $('Build Transcript Text').first().json;\nreturn [\n {\n json: {\n seoTitle: draft.seo_title || null,\n metaDescription: draft.meta_description || null,\n slug: draft.slug || null,\n tags: draft.tags || [],\n markdown: draft.markdown || '',\n sourceVideoId: src.videoId,\n sourceTitle: src.title,\n },\n },\n];" }, "id": "33333333-3333-4333-8333-333333333306", "name": "Format Blog Draft", "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": "Generate Blog Draft (LLM)", "type": "main", "index": 0 } ] ] }, "Generate Blog Draft (LLM)": { "main": [ [ { "node": "Format Blog Draft", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "pinData": {} }