8
n8n 中文网amn8n.com

使用Supadata、Claude Sonnet 4和WordPress将YouTube视频转换为SEO文章

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 22 个节点。主要使用 Set, Code, Wait, Filter, YouTube 等节点。 使用Supadata、Claude Sonnet 4和WordPress将YouTube视频转换为SEO文章

前置要求
  • 可能需要目标 API 的认证凭证
  • Anthropic API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "76f89f83c161d3dc4a2a2307b8474c26e91222cc4714d0dbc0ef5a91b47e83d1"
  },
  "nodes": [
    {
      "id": "e457294a-498f-4eff-864e-358896831040",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1936,
        1312
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "373070c8-4022-4047-9dcb-0577b83d7b48",
      "name": "循环遍历项目1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1344,
        1120
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "64d7bce2-fcc4-4536-b49f-8a8130f5f0a9",
      "name": "Loop Over Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -240,
        1120
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "383fefc1-cab4-4137-9dc0-1b7a37f7e9ca",
      "name": "Anthropic聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        304,
        1232
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude Sonnet 4"
        },
        "options": {
          "thinking": true
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "43bce4d5-588f-4be7-a400-d534bfe981ce",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        960
      ],
      "parameters": {
        "width": 1640,
        "height": 560,
        "content": "## Search New Videos"
      },
      "typeVersion": 1
    },
    {
      "id": "7e5a3733-4ca7-4c59-a5cc-1b6f351080cb",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        960
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 560,
        "content": "## Get the Most Viral Video (based on number of likes, views and comments)"
      },
      "typeVersion": 1
    },
    {
      "id": "d648a061-da1d-4746-91d3-0e0cc27d743b",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        960
      ],
      "parameters": {
        "color": 5,
        "width": 940,
        "height": 560,
        "content": "## Write the Article and Post it to WordPress drafts"
      },
      "typeVersion": 1
    },
    {
      "id": "244061f5-2f53-4da8-9333-968e6f982bab",
      "name": "SET YOUTUBE CHANNELS",
      "type": "n8n-nodes-base.set",
      "position": [
        -1744,
        1120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "71f75da1-ccba-429d-8bd3-3d6b6026b617",
              "name": "Youtube channel 1",
              "type": "string",
              "value": "Youtube channel 1"
            },
            {
              "id": "4a7773ad-ffd5-4f34-9a25-c6d66ef461c7",
              "name": "Youtube channel 2",
              "type": "string",
              "value": "Youtube channel 2"
            },
            {
              "id": "69408d6d-1fab-4a1a-b13b-e0aacd5ff131",
              "name": "Youtube channel 3",
              "type": "string",
              "value": "Youtube channel 3 (add more if needed)"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1bec1dc6-9f9e-4cd6-93c3-38617efa7af2",
      "name": "Search Youtube Channel",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1168,
        1328
      ],
      "parameters": {
        "url": "https://www.googleapis.com/youtube/v3/search",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "part",
              "value": "snippet"
            },
            {
              "name": "q",
              "value": "={{ $json.search }}"
            },
            {
              "name": "type",
              "value": "channel"
            },
            {
              "name": "key",
              "value": "ENTER YOUR API KEY"
            },
            {
              "name": "regionCode",
              "value": "US"
            },
            {
              "name": "maxResults",
              "value": "10"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "47a94130-279b-4e34-9e25-faf9727c2baf",
      "name": "Get YouTube Channel Videos",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -896,
        1120
      ],
      "parameters": {
        "limit": 10,
        "filters": {
          "channelId": "={{ $json.items[0].id.channelId }}"
        },
        "options": {
          "order": "date"
        },
        "resource": "video"
      },
      "typeVersion": 1
    },
    {
      "id": "1fdb0605-1093-4dd3-a399-4631dcd664b5",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -688,
        1120
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "snippet.title"
      },
      "typeVersion": 2
    },
    {
      "id": "e147fc1a-74c6-4266-a2f8-1d1d66a7941f",
      "name": "Filter by Date",
      "type": "n8n-nodes-base.filter",
      "position": [
        -480,
        1120
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b18a01f3-a39b-40eb-8421-0a4efc565ff7",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.snippet.publishTime.toDateTime().toMillis() / 1000 }}",
              "rightValue": "={{$now.toMillis() / 1000 - 216000}}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d5fb7afd-8bf2-4c5f-835d-0aa93d665f4f",
      "name": "获取 YouTube 视频",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -64,
        1328
      ],
      "parameters": {
        "options": {},
        "videoId": "={{ $json.id.videoId }}",
        "resource": "video",
        "operation": "get"
      },
      "typeVersion": 1
    },
    {
      "id": "44491508-bc13-4024-83f6-eaed3ff91546",
      "name": "Create Transcription",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        1024
      ],
      "parameters": {
        "url": "https://api.supadata.ai/v1/youtube/transcript",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "videoId",
              "value": "={{ $json.id }}"
            },
            {
              "name": "text",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "X-API-KEY",
              "value": "ENTER YOUR SUPADATA API KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "08243de1-24af-4b52-b266-cd9ec8a20f0f",
      "name": "Compose Article",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        1024
      ],
      "parameters": {
        "text": "=You are an AI copywriter + SEO assistant. Convert a YouTube [CONTENT_TYPE] transcript into a natural, engaging, fully SEO-optimized article.\n\n🔽 INPUT DATA (variables)\n\nYouTube Transcript: {{ $json.content }}\nYouTube Video Description: {{ $('Get the most Viral Video').item.json.snippet.description }}\nPrimary Topic / Hook: {{ $('Get the most Viral Video').item.json.snippet.title }}\nTarget Keyword List: [TARGET_KEYWORD_LIST_PLACEHOLDER]\n(choose the best one as PRIMARY)\nInternal Links (optional): [INTERNAL_LINK_URL_PLACEHOLDER]\nLink to original video:https://www.youtube.com/watch?v={{ $('Get the most Viral Video').item.json.id }}\nAuthor Name: [AUTHOR_NAME_PLACEHOLDER]\n\n\n✅ TASKS\n\nRead the transcript + description and understand the plot.\nPick a PRIMARY keyword (exact phrase from list) that best matches the story.\nPick 2–3 SECONDARY keywords (variations/related from the list).\nWrite an engaging article (800–1000 words): conversational, [BRAND_TONE_ADJECTIVES], but factual; organize for SEO and readers.\nOutput ONLY valid HTML (no markdown, no schema, no HTML comments). Nothing else.\nSatisfy Technical SEO Checklist (below) and show all required elements.\n\n\n🧭 CONTENT STRATEGY\n\nHook first: Start with the [HOOK_STRATEGY] in ≤100 words, include PRIMARY keyword.\nContext: Who are the people (full names first mention), why it matters.\nFlow: Tell it like a story ([CONTENT_STRUCTURE_OPTIONS]). Use 2–3 specific H2s.\nQuotes: Paraphrase or quote brief impactful lines from transcript.\nAnswer user intent: [USER_INTENT_QUESTIONS].\nClose strong: Recap takeaway, tease related [CONTENT_CATEGORY] (internal link).\n\nTone: [BRAND_VOICE_DESCRIPTION]. Use words like [BRAND_SPECIFIC_VOCABULARY] when natural. Avoid fluff.\n\n🛠 TECHNICAL SEO CHECKLIST (MUST PASS)\n\nTitle (H1): 50–60 chars, PRIMARY keyword near start. One H1 only.\nMeta description: 150–160 chars, includes PRIMARY keyword, persuasive.\nSlug suggestion: short, lowercase, hyphenated; contains PRIMARY keyword (return it in a data-slug comment-less attribute on the <article> tag: data-slug=\"your-slug\").\nPRIMARY keyword placement: first 100 words, one H2, last paragraph (CTA), and once bolded.\nSECONDARY keywords: 2–3 sprinkled naturally (overall density <2%).\nSubheadings: H2 every ≤300 words; at least one H2 carries a SECONDARY keyword.\nReadability rules (aim to please Yoast/RankMath):\n\n≥30% sentences start with transition words (e.g., \"However\", \"Moreover\").\nPassive voice ≤10%.\nNo more than 2 consecutive sentences starting with the same word.\nParagraphs ≤150 words; avg sentence length ≤20 words.\n\n\nInternal link: ≥1 to my site with descriptive anchor (skip if none provided).\nExternal link: ≥1 authoritative source besides YouTube if possible; always include the original video with rel=\"nofollow\".\nTable of contents: simple <ul> with in-page anchors under a <nav id=\"toc\"> block.\nConclusion CTA: invite to [CTA_ACTION], reiterate PRIMARY keyword once.\nWord count: 650–950 words (stay in range if transcript is short).\nNo keyword stuffing: natural only.\n\n\nName Recognition Strategy:\n\nExtract all names from transcript, description and video title\nUse full names when first mentioned, then first names or nicknames. Avoid phrases like [AVOID_PHRASES_PLACEHOLDER]\nBuild character: Give readers context about who these people are in 1-2 sentences\nConnect the dots: Explain relationships between people involved\nTag relevant platforms: Mention their [RELEVANT_PLATFORMS] accounts when relevant\nActive voice always: \"[PERSON_A] called out [PERSON_B]\" not \"[PERSON_B] was called out\"\n\n📦 OUTPUT FORMAT (RETURN ONLY THIS)\n<!-- ====== START HTML OUTPUT ====== -->\n<h1>[TITLE with PRIMARY keyword]</h1>\n<meta name=\"description\" content=\"[150-160 char meta with PRIMARY keyword]\">\n<article data-slug=\"[your-slug]\">\n<p><strong>[PRIMARY keyword]</strong> … [intro hook ≤100 words]</p>\n<h2 id=\"sec-1\">[Subheading with a SECONDARY keyword]</h2>\n<p>...</p>\n<h2 id=\"sec-2\">[Names/platforms/context]</h2>\n<p>...</p>\n<h2 id=\"sec-3\">[Reactions/impact]</h2>\n<p>...</p>\n<p>Watch the original video <a href=\"\" rel=\"nofollow\">here</a>. [Optional extra external link]</p>\n<p>Related: <a href=\"[internal_link_url]\">[internal_link_title]</a></p>\n<p><strong>Final take:</strong> [Wrap-up with PRIMARY keyword once more + CTA]</p>\n</article>\n<!-- ====== END HTML OUTPUT ====== -->\n\n✅ SELF-CHECK BEFORE RETURNING\n\nDid I pick and state PRIMARY + SECONDARY keywords?\nTitle & meta within limits?\nPRIMARY keyword in: title, first 100 words, meta, one H2, image alt.\nInternal + external link present?\nImages present with alt?\n800–1000 words?\nOutput ONLY HTML? (No markdown, no explanations, no extra keyword highlights like \"**\".)\nValid HTML tags; no unclosed tags.\nNO MARKDOWN SYMBOLS ANYWHERE. DO NOT MARK INSERTED KEYWORDS WITH ANY SYMBOLS\nUse names and surnames whereever possible.\n\n\nNOTES\n\nIf transcript lacks names, use those in description/title; otherwise infer from topic but don't invent people.\nDon't be too formal. You write a blog about [CONTENT_NICHE], so the text must be [CONTENT_STYLE_REQUIREMENTS]\nNo defamatory claims: stick to transcript facts.\nIf any input is missing (e.g., internal links), skip gracefully but keep structure.",
        "options": {
          "systemMessage": "You are a seasoned, charismatic blogger"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "2ba19b67-4460-47ec-bd40-8c4f212e42e2",
      "name": "Split title and body",
      "type": "n8n-nodes-base.code",
      "position": [
        688,
        1024
      ],
      "parameters": {
        "jsCode": "const html = items[0].json.output;\nconst h1Match = html.match(/<h1>(.*?)<\\/h1>/i);\nconst title = h1Match ? h1Match[1] : '';\nconst body = html.replace(h1Match[0], '').trim();\n\nreturn [\n  {\n    json: {\n      title,\n      body,\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e538ba77-75bb-4d0d-84ed-393143e51733",
      "name": "Create WordPress Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        1024
      ],
      "parameters": {
        "url": "https://YOUR-URL....",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendQuery": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "title",
              "value": "={{ $json.title }}"
            },
            {
              "name": "status",
              "value": "draft"
            },
            {
              "name": "content",
              "value": "={{ $json.body }}"
            }
          ]
        },
        "queryParameters": {
          "parameters": [
            {
              "name": "Parameter if needed",
              "value": "Value if needed"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ad2d030b-8223-42a7-905c-971ba15c6552",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        624
      ],
      "parameters": {
        "width": 936,
        "height": 324,
        "content": "## How to configure the workflow\n- Connect your Google Account to all YouTube nodes to enable video discovery and retrieval functionality (Tutorial: https://www.youtube.com/watch?v=BfW1JpJ39Ek).\n- Integrate your Supadata account with the 'Create Transcription' node for high-quality video transcription services.\n- Connect your Anthropic account for AI-powered article generation (Tutorial: https://www.youtube.com/watch?v=1jl_vBoVvq0) - I recommend using Claude Sonnet 4 for text generation, however GPT models are also supported.\n- Navigate to the 'Compose Article' node and customize the following [PLACEHOLDERS] according to your brand requirements.\n- Configure the 'Create WordPress Post' node according to your WordPress website API.\n\n## Starting the workflow\n- After all services are connected - access the 'SET YOUTUBE CHANNELS' node and input the exact YouTube channel names you want to monitor.\n- Activate the workflow!"
      },
      "typeVersion": 1
    },
    {
      "id": "210b58a3-acf0-44f4-b267-1359012e713e",
      "name": "Wait for 5 seconds (avoid API overload)",
      "type": "n8n-nodes-base.wait",
      "position": [
        -944,
        1328
      ],
      "webhookId": "8eba5872-32ee-4a9c-b296-5dc86c770275",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "4e23c456-5f10-403a-b4fa-cf28e9b2d93c",
      "name": "Divide items into Title and Search phrases",
      "type": "n8n-nodes-base.code",
      "position": [
        -1536,
        1120
      ],
      "parameters": {
        "jsCode": "const data = items[0].json;\nconst output = [];\nfor (const [title, search] of Object.entries(data)) {\n  output.push({\n    json: {\n      title,\n      search\n    }\n  });\n}\n\nreturn output;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "591f562a-3a4f-4cb8-b4c2-b5409fd33e3a",
      "name": "Schedule Trigger (Start every 6 hours)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1936,
        1120
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 */6 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c5a55f4b-fda1-48f5-a439-1f0f5956bcbe",
      "name": "Get the most Viral Video",
      "type": "n8n-nodes-base.code",
      "position": [
        -16,
        1024
      ],
      "parameters": {
        "jsCode": "function score(stat) {\n  const views = Number(stat.viewCount) || 0;\n  const likes = Number(stat.likeCount) || 0;\n  const comments = Number(stat.commentCount) || 0;\n  return comments + (likes * 10) + (views * 20);\n}\n\nitems.sort((a, b) => {\n  return score(b.json.statistics) - score(a.json.statistics);\n});\n\nreturn [items[0]];"
      },
      "typeVersion": 2
    }
  ],
  "pinData": {},
  "connections": {
    "Filter by Date": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose Article": {
      "main": [
        [
          {
            "node": "Split title and body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Get YouTube Channel Videos",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Search Youtube Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [
          {
            "node": "Get the most Viral Video",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get YouTube Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get YouTube Video": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Filter by Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Transcription": {
      "main": [
        [
          {
            "node": "Compose Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET YOUTUBE CHANNELS": {
      "main": [
        [
          {
            "node": "Divide items into Title and Search phrases",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split title and body": {
      "main": [
        [
          {
            "node": "Create WordPress Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Compose Article",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Search Youtube Channel": {
      "main": [
        [
          {
            "node": "Wait for 5 seconds (avoid API overload)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the most Viral Video": {
      "main": [
        [
          {
            "node": "Create Transcription",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get YouTube Channel Videos": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger (Start every 6 hours)": {
      "main": [
        [
          {
            "node": "SET YOUTUBE CHANNELS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for 5 seconds (avoid API overload)": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Divide items into Title and Search phrases": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 内容创作, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量22
分类2
节点类型13
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Pavlo Hurhu

Pavlo Hurhu

@pavlohurhu

Building rock-solid automations with n8n for over a year. Love sharing reliable workflows that help teams work smarter, not harder.

外部链接
在 n8n.io 查看

分享此工作流