使用Gemini AI和竞品分析的SEO元标签生成器
高级
这是一个自动化工作流,包含 27 个节点。主要使用 Set, Code, Html, HttpRequest, GoogleSheets 等节点。 使用Gemini AI和Google Sheets竞品分析生成SEO元标签
前置要求
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
- •Google Gemini API Key
使用的节点 (27)
分类
-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "12b5738dbe70639f3b7d069a122c5f581ca4347fcd62ddef39ad5c33b40e7e5e",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "21097b90-82b1-4c0b-aa25-889a470b99bd",
"name": "获取 sheet1 中的行",
"type": "n8n-nodes-base.googleSheets",
"position": [
-2000,
192
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "New",
"lookupColumn": "Status"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1807322001,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit#gid=1807322001",
"cachedResultName": "Control Panel"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit?usp=drivesdk",
"cachedResultName": "Seo Meta generation"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "6q55WdTedKPZERoF",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.7
},
{
"id": "a95a3e5d-4bce-47a0-9fc6-8adf5a4ca8d4",
"name": "结构化输出解析器",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-528,
240
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"primary_keyword\": {\n \"type\": \"string\",\n \"description\": \"Main keyword or topic for SEO or content generation.\"\n },\n \"semantic_keyword_cluster\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"List of related semantic keywords around the primary keyword.\"\n },\n \"search_intent\": {\n \"type\": \"string\",\n \"enum\": [\"Informational\", \"Navigational\", \"Transactional\", \"Commercial\"],\n \"description\": \"The search intent type of the keyword.\"\n },\n \"target_audience\": {\n \"type\": \"string\",\n \"description\": \"The main audience or customer segment targeted.\"\n },\n \"content_angle\": {\n \"type\": \"string\",\n \"description\": \"The content style or perspective, e.g., Deep Dive, Case Study, How-To.\"\n },\n \"content_summary\": {\n \"type\": \"string\",\n \"description\": \"A short explanation or summary of the content.\"\n }\n },\n \"required\": [\n \"primary_keyword\",\n \"semantic_keyword_cluster\",\n \"search_intent\",\n \"target_audience\",\n \"content_angle\",\n \"content_summary\"\n ]\n}\n"
},
"typeVersion": 1.3
},
{
"id": "17a49a52-d070-4bf1-83d1-c0c74218ac56",
"name": "Google 搜索结果页",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
-304,
16
],
"parameters": {
"url": "=https://serpapi.com/search",
"options": {
"redirect": {
"redirect": {}
},
"response": {
"response": {
"responseFormat": "text"
}
},
"allowUnauthorizedCerts": true
},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "api_key",
"value": "<your-api-key>"
},
{
"name": "engine",
"value": "=google"
},
{
"name": "q",
"value": "={{ $json.output.primary_keyword }}"
},
{
"name": "google_domain",
"value": "google.com"
},
{
"name": "hl",
"value": "en"
}
]
}
},
"typeVersion": 4.2,
"alwaysOutputData": false
},
{
"id": "4b99ad81-9984-4f03-ab7c-f891d182178f",
"name": "代码1",
"type": "n8n-nodes-base.code",
"position": [
-80,
16
],
"parameters": {
"jsCode": "// --- DYNAMIC SETUP ---\n\n// 1. Get the raw string from the 'data' key (Your correct fix!)\nconst rawSerpDataString = $input.first().json.data; \n\n// 2. THIS IS THE KEY: Parse that string into a proper JSON object\nconst serpApiOutput = JSON.parse(rawSerpDataString);\n\n// 3. Now we can safely access the organic_results\nconst organicResults = serpApiOutput.organic_results || [];\n\n// 4. Get our AI's analysis from the VERY FIRST Gemini node in the loop\n// **IMPORTANT**: This line assumes your first Gemini analyzer node is named 'Basic LLM Chain'\nconst ourPageAnalysis = $('AI Analyzer').first().json.output;\n\n// --- INTELLIGENT \"BAG OF WORDS\" ALLOWLIST ---\n\n// 5. Combine all our keywords into one big string\nconst allKeywordsString = [ourPageAnalysis.primary_keyword, ...ourPageAnalysis.semantic_keyword_cluster].join(' ');\n\n// 6. Define common \"stop words\" to ignore\nconst stopWords = new Set(['a', 'an', 'and', 'the', 'for', 'to', 'in', 'of', 'with', 'on', 'is', 'it', 'custom', 'websites', 'services']);\n\n// 7. Create our dynamic \"bag of words\"\nconst allowlist = allKeywordsString\n .toLowerCase()\n .split(/\\s+/) // Split by spaces\n .filter(word => word.length > 2 && !stopWords.has(word)); // Remove short words and stop words\n\nconst cleanedResults = [];\n\nfor (const result of organicResults) {\n const title = result.title ? result.title.trim() : '';\n const description = result.snippet ? result.snippet.trim() : '';\n const link = result.link ? result.link.trim() : '';\n\n const textToScan = (title + ' ' + description).toLowerCase();\n\n // --- DYNAMIC FILTERING LOGIC ---\n // Check if the competitor text contains ANY of the words from our \"bag of words\"\n const isRelevant = allowlist.some(keyword => textToScan.includes(keyword));\n\n if (title && description && link && isRelevant) {\n cleanedResults.push({\n title: title,\n description: description,\n link: link\n });\n }\n}\n\n// We only need the top 5-7 for AI analysis\nconst topRelevantResults = cleanedResults.slice(0, 7);\n\n// Pass the cleaned results to the next node\nreturn [{ json: { competitor_data_for_ai: topRelevantResults } }];"
},
"typeVersion": 2
},
{
"id": "b7c1c026-7fcb-471c-927d-f824c3d8a227",
"name": "更新表格中的行",
"type": "n8n-nodes-base.googleSheets",
"position": [
1776,
304
],
"parameters": {
"columns": {
"value": {
"URL": "={{ $('Update row in sheet1').item.json.URL }}",
"Status": "Generated",
"Ranking Factor ": "={{ $('Code').item.json.competitor_patterns }}",
"Current Meta Title": "={{ $('Edit Fields').item.json.current_title }}",
"Generated Meta Title": "={{ $json.optimized_title }}",
"Current Meta Description": "={{ $('Edit Fields').item.json.description }}",
"Generated Meta Description": "={{ $json.optimized_meta }}"
},
"schema": [
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Current Meta Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Current Meta Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Current Meta Description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Current Meta Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Generated Meta Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Generated Meta Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Generated Meta Description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Generated Meta Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Ranking Factor ",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Ranking Factor ",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"URL"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1807322001,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit#gid=1807322001",
"cachedResultName": "Control Panel"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit?usp=drivesdk",
"cachedResultName": "Seo Meta generation"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "6q55WdTedKPZERoF",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.7
},
{
"id": "75ec0306-25d5-44a1-a8b8-f26a6d0323d7",
"name": "遍历项目",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1776,
192
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "981f9de9-0b0e-4131-93b6-b10cb86cf9cf",
"name": "更新 sheet1 中的行",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1552,
16
],
"parameters": {
"columns": {
"value": {
"URL": "={{ $json.URL }}",
"Status": "Generating- wait for a few minutes"
},
"schema": [
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Current Meta Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Current Meta Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Current Meta Description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Current Meta Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Suggested Meta Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Suggested Meta Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Suggested Meta Description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Suggested Meta Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Key Patterns Found",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Key Patterns Found",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"URL"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1807322001,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit#gid=1807322001",
"cachedResultName": "Control Panel"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit?usp=drivesdk",
"cachedResultName": "Seo Meta generation"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "6q55WdTedKPZERoF",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.7
},
{
"id": "80628c57-5dcc-4302-85f9-947d04e47895",
"name": "HTML",
"type": "n8n-nodes-base.html",
"position": [
-1104,
16
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "current_title",
"cssSelector": "title",
"returnArray": true
},
{
"key": "description",
"attribute": "content",
"cssSelector": "meta[name=\"description\"]",
"returnArray": true,
"returnValue": "attribute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "aaf1562b-8ff7-4f61-b696-31441d296df5",
"name": "Google Sheets 触发器",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-2224,
192
],
"parameters": {
"event": "rowAdded",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1807322001,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit#gid=1807322001",
"cachedResultName": "Control Panel"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1goD6RasKx7GMx7yMa1ruigSE56IsnIkHnoUs6tFxTiE/edit?usp=drivesdk",
"cachedResultName": "Seo Meta generation"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"id": "YTE594cXs6665NEf",
"name": "Google Sheets Trigger account 2"
}
},
"typeVersion": 1
},
{
"id": "ffa6f621-4744-4003-99d1-7172161a558a",
"name": "编辑字段",
"type": "n8n-nodes-base.set",
"position": [
-880,
16
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "cc1dd4d8-f155-4faf-be28-85bb4022dc3b",
"name": "current_title",
"type": "string",
"value": "={{ $json.current_title[0] }}"
},
{
"id": "80ba3fd4-9dae-4d35-8c94-2ab8d6a66a33",
"name": "description",
"type": "string",
"value": "={{ $json.description[0] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "43ded5ba-a2dc-44f1-88a4-88acc2c886f8",
"name": "Google Gemini 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
-784,
304
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "jDqIjAl6Wf24Lyq4",
"name": "N8n automation demo API"
}
},
"typeVersion": 1
},
{
"id": "ed7b7a51-ca89-4e48-b7f3-3aabf6f824e2",
"name": "Google Gemini 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
80,
320
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "jDqIjAl6Wf24Lyq4",
"name": "N8n automation demo API"
}
},
"typeVersion": 1
},
{
"id": "3f0be34f-b1ba-4b02-bd7b-fe7f76852bb8",
"name": "Google Gemini 聊天模型2",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
656,
240
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"id": "jx3hgp0b9JRBPtWe",
"name": "Ai Business Analyst API"
}
},
"typeVersion": 1
},
{
"id": "017bb8e3-82a8-4d24-85c7-a67f94f85850",
"name": "代码",
"type": "n8n-nodes-base.code",
"position": [
528,
16
],
"parameters": {
"jsCode": "// Get the messy text output from the Master Generator AI\nconst messyText = $json.text || '';\n\n// This regex finds and extracts ONLY the JSON part, ignoring everything else\nconst match = messyText.match(/\\{[\\s\\S]*\\}/);\n\nlet finalOutput = {};\n\nif (match && match[0]) {\n try {\n // Try to parse the clean JSON string\n finalOutput = JSON.parse(match[0]);\n } catch (error) {\n // If parsing fails, create an error object\n finalOutput = {\n optimized_title: 'PARSE_ERROR',\n optimized_meta: `Failed to parse JSON: ${error.message}`\n };\n }\n} else {\n // If no JSON is found at all, create an error object\n finalOutput = {\n optimized_title: 'NO_JSON_FOUND',\n optimized_meta: 'The AI did not return a valid JSON object.'\n };\n}\n\n// Pass the perfect, clean JSON object to the next node\nreturn [{ json: finalOutput }];"
},
"typeVersion": 2
},
{
"id": "14b14114-3cde-45d5-a646-f4e1ff640e1c",
"name": "代码2",
"type": "n8n-nodes-base.code",
"position": [
1152,
0
],
"parameters": {
"jsCode": "// Get the JSON string directly from the 'text' property\nconst jsonString = $json.text || '{}';\n\nlet finalOutput = {};\n\ntry {\n // Try to parse the clean JSON string\n finalOutput = JSON.parse(jsonString);\n} catch (error) {\n // If parsing fails for any reason, create an error object\n finalOutput = {\n optimized_title: 'PARSE_ERROR',\n optimized_meta: `Failed to parse JSON from AI: ${error.message}`\n };\n}\n\n// Pass the final JSON object to the next node\nreturn [{ json: finalOutput }];"
},
"typeVersion": 2
},
{
"id": "353ce1ea-4f1a-474f-b651-ede4fadf622e",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2288,
-672
],
"parameters": {
"width": 448,
"height": 1200,
"content": "# 1. 从这里开始:获取待办事项列表"
},
"typeVersion": 1
},
{
"id": "2b6ff240-48f7-435d-aba9-c399c317e6df",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1824,
-672
],
"parameters": {
"width": 448,
"height": 1200,
"content": "# 2. 逐个处理 URL"
},
"typeVersion": 1
},
{
"id": "f6e32900-1ac4-4f4c-8108-821d2cde1235",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1360,
-672
],
"parameters": {
"width": 896,
"height": 1200,
"content": "# 3. 阶段 1:分析我们自己的页面"
},
"typeVersion": 1
},
{
"id": "0aff16f7-3317-4e5f-80d3-cd77b7daab6d",
"name": "AI 分析器",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-656,
16
],
"parameters": {
"text": "=You are an expert SEO Analyst and Content Strategist. Your task is to perform a deep analysis of the provided webpage text and extract key strategic insights. Your response must be a single, valid JSON object and nothing else. Do not add any introductory text, explanations, or markdown formatting like ```json.\n\n### WEBPAGE TEXT ###\n\"{{ $('Scrape Website').item.json.data }}\"\n\n### ANALYSIS INSTRUCTIONS ###\nBased on the text provided, perform the following analysis and populate the JSON object with these exact keys:\n\n1. `primary_keyword`: Identify the single, most important primary keyword or search phrase the content is targeting.\n2. `semantic_keyword_cluster`: Provide a JSON array of 5-7 closely related secondary and LSI keywords that create a semantic cluster around the primary keyword.\n3. `search_intent`: Determine the primary search intent. Choose ONLY ONE from this list: [\"Informational\", \"Commercial Investigation\", \"Transactional\", \"Navigational\"].\n4. `target_audience`: Briefly describe the target audience for this content in a few words (e.g., \"Beginner Hobbyists\", \"IT Professionals\", \"Small Business Owners\").\n5. `content_angle`: Identify the content's angle or format. Choose ONLY ONE from this list: [\"Listicle/Top X\", \"How-To Guide/Tutorial\", \"Product Review\", \"Product Comparison\", \"Case Study\", \"News/Report\", \"Opinion/Editorial\", \"Deep Dive/Explanation\"].\n6. `content_summary`: Write a one-sentence summary that captures the core value proposition of the content for the target audience.",
"batching": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "0479e704-5dfb-4801-a7f1-2b0fa7df41aa",
"name": "抓取网站",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1328,
16
],
"parameters": {
"url": "https://api.scrapingdog.com/scrape",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "api_key",
"value": "<your-api-key>"
},
{
"name": "url",
"value": "={{ $json.URL }}"
},
{
"name": "dynamic",
"value": "true"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "432adc86-31d1-461e-9421-bad8ca367b35",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-448,
-672
],
"parameters": {
"width": 512,
"height": 1200,
"content": "# 4. 阶段 2:窥探竞争对手"
},
"typeVersion": 1
},
{
"id": "011d1b47-04e4-4ba2-8010-d2cb0321cc4b",
"name": "竞争对手分析",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
176,
16
],
"parameters": {
"text": "=### ROLE ###\nYou are an expert SEO pattern detection bot. Your only job is to analyze the provided list of competitor titles and descriptions from a Google search. Summarize the common patterns, tones, and formats you observe, thinking like a world-class SEO strategist.\n\n### COMPETITOR DATA ###\n{{ JSON.stringify($node[\"Code1\"].json.competitor_data_for_ai) }}\n\n### TASK & STRICT OUTPUT RULES ###\nAnalyze the data and then respond ONLY with a single, valid JSON object. Do not add any conversational text, introductions, explanations, or markdown formatting like ```json. Your output must match the structure of the example below exactly.\n\n**Example of Perfect Output structure:**\n{\n \"competitor_patterns\": \"uses numbers for lists, includes the word 'Best', mentions specific brands (e.g., Framer), focuses on inspiration and examples, asks a question\"\n}",
"batching": {},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "adcba714-75d6-46b6-8661-e6494424fb29",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
-672
],
"parameters": {
"width": 592,
"height": 1200,
"content": "# 5. 找出竞争对手策略"
},
"typeVersion": 1
},
{
"id": "70030a73-ec32-4a63-af30-6ec24a39c981",
"name": "主生成器",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
800,
0
],
"parameters": {
"text": "=You are an SEO optimization API. Your ONLY job is to return a valid JSON object. Your primary function is to adhere to strict length constraints above all else. Do not add any conversational text, introductions, or markdown formatting.\n\n### INTEL ###\n- Real Target Keyword: \"{{ $node['AI Analyzer'].json.output.primary_keyword }}\"\n- Our Page Summary: \"{{ $node['AI Analyzer'].json.output.content_summary }}\"\n- Our Page Angle: \"{{ $node['AI Analyzer'].json.output.content_angle }}\"\n- Competitor Patterns: \"{{ $json.competitor_patterns }}\"\n\n### YOUR FINAL TASK ###\nBased on ALL of the above intel, create a title and description that will rank for the Real Target Keyword.\n\n**CRITICAL RULES (NON-NEGOTIABLE):**\n1. The `optimized_title` value MUST be strictly under 60 characters including whitespaces .\n2. The `optimized_meta` value MUST be strictly under 160 characters including whitespaces.\n3. You MUST validate the character counts yourself before generating the final JSON. Failure to meet these character limits will result in an invalid output.\n\n### STRICT OUTPUT EXAMPLE ###\nYour response MUST be a single, valid JSON object matching this exact structure.Do not add any conversational text, introductions, explanations, or markdown formatting like ```json. Your output must match the structure of the example below exactly.\n\n// This is a perfect example of a valid response that follows all length rules:\n{\n \"optimized_title\": \"10 Best Framer Websites for Inspiration (2025)\",\n \"optimized_meta\": \"Discover top Framer examples for agencies and SaaS. Get inspired by the best no-code designs and build your amazing website today.\"\n}",
"batching": {},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "6f5a055b-be9b-4c45-b0b6-6b3126e65cd8",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
704,
-672
],
"parameters": {
"width": 592,
"height": 1200,
"content": "# 6. 阶段 3:主生成器"
},
"typeVersion": 1
},
{
"id": "bbb69642-c210-4827-83da-e3a98eb914c6",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1344,
-672
],
"parameters": {
"width": 592,
"height": 1200,
"content": "# 7. 最终写回"
},
"typeVersion": 1
},
{
"id": "c59503df-a7a8-42c8-a55b-e0f514e690e2",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2368,
-1088
],
"parameters": {
"color": 5,
"width": 4368,
"height": 1792,
"content": "# SEO 元标题和描述生成器"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Code": {
"main": [
[
{
"node": "Master Generator",
"type": "main",
"index": 0
}
]
]
},
"HTML": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Code1": {
"main": [
[
{
"node": "Competitor Analysis",
"type": "main",
"index": 0
}
]
]
},
"Code2": {
"main": [
[
{
"node": "Update row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Googl SERP": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"AI Analyzer": {
"main": [
[
{
"node": "Googl SERP",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "AI Analyzer",
"type": "main",
"index": 0
}
]
]
},
"Scrape Website": {
"main": [
[
{
"node": "HTML",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Update row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Master Generator": {
"main": [
[
{
"node": "Code2",
"type": "main",
"index": 0
}
]
]
},
"Competitor Analysis": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Update row in sheet": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet1": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Update row in sheet1": {
"main": [
[
{
"node": "Scrape Website",
"type": "main",
"index": 0
}
]
]
},
"Google Sheets Trigger": {
"main": [
[
{
"node": "Get row(s) in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Analyzer",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Analyzer",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "Competitor Analysis",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model2": {
"ai_languageModel": [
[
{
"node": "Master Generator",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
使用 Gemini AI 进行 X (Twitter) 品牌情感分析及 Slack 提醒
使用 Gemini AI 进行 X (Twitter) 品牌情感分析及 Slack 提醒
If
Set
Code
+14
42 节点Hardikkumar
使用Bright Data和Google Gemini的Google Maps企业抓取和线索丰富
使用Bright Data和Google Gemini的Google Maps企业抓取和线索丰富工具
Set
Code
Wait
+11
29 节点Ranjan Dailata
潜在客户开发
使用 Bright Data API 和 AI 抓取分析 Google 广告并发送邮件报告
使用 Bright Data API 和 AI 抓取分析 Google 广告并发送邮件报告
Set
Code
Gmail
+15
45 节点Zacharia Kimotho
市场调研
使用 Gemini AI 转录和摘要的 YouTube 频道监控并同步至 Google Sheets
使用 Gemini AI 转录和摘要的 YouTube 频道监控并同步至 Google Sheets
If
Set
Code
+10
33 节点Muhammad Asadullah
内容创作
第一轮 Telegram 和 LinkedIn 快速通道 AI 招聘助手
AI候选人筛选流程:LinkedIn到Telegram,集成Gemini与Apify
If
Set
Code
+15
55 节点Dean Pike
人力资源