8
n8n 中文网amn8n.com

使用 Bright Data 和 Gemini AI 生成 SEO 优化标题与元描述

高级

这是一个Market Research, Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 Set, HttpRequest, GoogleSheets, ManualTrigger, SplitInBatches 等节点。 使用 Bright Data 和 Gemini AI 生成 SEO 优化标题与元描述

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "db80165df40cb07c0377167c050b3f9ab0b0fb04f0e8cae0dc53f5a8527103ca",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "63865e5c-9e83-49ad-8d51-02391ee9e36c",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1728,
        464
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e935f831-25e0-4325-b0a4-72dd632c6c46",
      "name": "Fetch Google Search Results JSON",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        -816,
        480
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {}
          },
          "redirect": {
            "redirect": {}
          }
        },
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "serp_api1"
            },
            {
              "name": "url",
              "value": "=https://www.google.com/search?q={{ $json.search_term .replaceAll(\" \", \"+\")}}&start=0&brd_json=1"
            },
            {
              "name": "country",
              "value": "={{ $json['country code'] }}"
            },
            {
              "name": "format",
              "value": "raw"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "async",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "gfLRVcGG09VEZv5B",
          "name": "Brightdata Header"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "ee4881f0-9148-493e-825e-ce2dde83fbae",
      "name": "Get Keywords",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1520,
        464
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=0",
          "cachedResultName": "Keywords to Track"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
          "cachedResultName": "Position Tracking for Keyword + Dashboard "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ZAI2a6Qt80kX5a9s",
          "name": "Google Sheets account✅ "
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "69fff95a-24de-4331-89a8-14d4ea25c066",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1280,
        464
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "9b6c4df9-90af-431a-9d85-54ea38c49155",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -400,
        624
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "Xp5T9q3YYxBIw2nd",
          "name": "Google Gemini(PaLM) Api account✅"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4f164104-6881-4636-b238-d75c7d52f866",
      "name": "Generate New title and metadescriptins",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -400,
        464
      ],
      "parameters": {
        "text": "=You are an advanced SEO strategist and content optimization engine.\n\nYour task is to:\n1. Analyze the list of top-ranking page titles and meta descriptions for a given keyword.\n2. Infer common SEO patterns, content structure, and user search intent.\n3. Use these insights to generate a highly optimized new **Title** and **Meta Description** that:\n   - Aligns with the dominant SERP format\n   - Matches search intent\n   - Stands out enough to drive clicks (CTR-optimized)\n   - Includes the target keyword naturally\n   - Sounds trustworthy, relevant, and modern\n\n---\n\n### Input Keyword:\n{{ $('set keyword').item.json.search_term }}\n### Top SERP Results (Titles + Descriptions):\n{{ $json.titlesDescriptions }}\n\n### \"People Also Ask\" Questions:\n{{ $json.paaQuestions }}\n\n---\n\n### Output Format:\n{\n  \"intent\": \"[Label the dominant search intent. Examples: Listicle, How-to, Informational, Commercial, Review, Product Page, Case Study, etc.]\",\n  \"dominant_patterns\": {\n  \"title_structure\": \"[Respond only with the generalized pattern using placeholders. No full sentences. No explanations.]\",\n  \"meta_structure\": \"[Respond only with the generalized meta pattern using placeholders. No full sentences. No explanations.]\"\n},\n  \"optimized_title\": \"[SEO-optimized title for the keyword]\",\n  \"optimized_meta\": \"[Well-written meta description under 160 characters]\",\n  \"cta\": \"[Optional call-to-action if helpful]\"\n}\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "d150f732-b580-430b-9a2d-d225b73839f9",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -192,
        656
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"intent\": \"[Label the dominant search intent. Examples: Listicle, How-to, Informational, Commercial, Review, Product Page, Case Study, etc.]\",\n  \"dominant_patterns\": {\n  \"title_structure\": \"[Respond only with the generalized pattern using placeholders. No full sentences. No explanations.]\",\n  \"meta_structure\": \"[Respond only with the generalized meta pattern using placeholders. No full sentences. No explanations.]\"\n},\n  \"optimized_title\": \"[SEO-optimized title for the keyword]\",\n  \"optimized_meta\": \"[Well-written meta description under 160 characters]\",\n  \"cta\": \"[Optional call-to-action if helpful]\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "8529bfb4-a3cb-4bc1-b83e-a6ed777bf1a8",
      "name": "meta structure",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        464
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "660979bb-be4d-4551-b15a-1963b9c1b4d1",
              "name": "Keyword",
              "type": "string",
              "value": "={{ $('Loop Over Items').item.json.search_term }}"
            },
            {
              "id": "334b8afd-d8ae-4b75-8f03-3f9315870268",
              "name": "intent",
              "type": "string",
              "value": "={{ $json.output.intent }}"
            },
            {
              "id": "b2f9402c-7f22-4081-b5ac-494c6a3f9869",
              "name": "dominant_patterns - meta_structure",
              "type": "string",
              "value": "={{ $json.output.dominant_patterns.meta_structure }}"
            },
            {
              "id": "018ce0e2-5af2-40df-adc5-2ab1d8977d05",
              "name": "dominant_patterns - title_structure",
              "type": "string",
              "value": "={{ $json.output.dominant_patterns.title_structure }}"
            },
            {
              "id": "6890732d-c773-4254-bb3d-2acdcab32ef2",
              "name": "optimized_title",
              "type": "string",
              "value": "={{ $json.output.optimized_title }}"
            },
            {
              "id": "99ef63dc-c8e3-48e5-8d29-9c7019b019b2",
              "name": "optimized_meta",
              "type": "string",
              "value": "={{ $json.output.optimized_meta }}"
            },
            {
              "id": "d4768bd4-23c0-4bf1-8e88-51c21e314cf9",
              "name": "cta",
              "type": "string",
              "value": "={{ $json.output.cta }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b1271960-96c0-48a4-9bd6-07325b0ea5e1",
      "name": "Create new meta and Structure",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        112,
        464
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Keyword",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Keyword",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "country code",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "country code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "page",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "intent",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "intent",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "dominant_patterns - meta_structure",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "dominant_patterns - meta_structure",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "dominant_patterns - title_structure",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "dominant_patterns - title_structure",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "optimized_title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "optimized_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "optimized_meta",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "optimized_meta",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CTA",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "CTA",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cta",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "cta",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "Keyword"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit#gid=0",
          "cachedResultName": "Keywords to Track"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=drivesdk",
          "cachedResultName": "Position Tracking for Keyword + Dashboard "
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "ZAI2a6Qt80kX5a9s",
          "name": "Google Sheets account✅ "
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "70796069-27d9-4076-8936-e5ec75ab42e8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        384
      ],
      "parameters": {
        "width": 980,
        "height": 504,
        "content": "## Analyze title and meta description formats for top 10 pages"
      },
      "typeVersion": 1
    },
    {
      "id": "ad89de82-a005-4851-8c40-102b83f3c912",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1584,
        384
      ],
      "parameters": {
        "width": 200,
        "height": 320,
        "content": "- Make a copy of this [G sheet](https://docs.google.com/spreadsheets/d/1QU9rwawCZLiYW8nlYYRMj-9OvAUNZoe2gP49KbozQqw/edit?usp=sharing)\n\n- Add your desired keywords"
      },
      "typeVersion": 1
    },
    {
      "id": "571a1981-a9f3-4b66-8c9f-3d4779425df6",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        288
      ],
      "parameters": {
        "color": 5,
        "width": 200,
        "height": 340,
        "content": "- We loop over each item one at a time"
      },
      "typeVersion": 1
    },
    {
      "id": "5b39d950-56e9-4069-81f0-8a061a56795d",
      "name": "set keyword",
      "type": "n8n-nodes-base.set",
      "position": [
        -1008,
        480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cee3c6fe-dc44-43b2-9243-a1f1a62f9fa1",
              "name": "search_term",
              "type": "string",
              "value": "={{ $json.Keyword }}"
            },
            {
              "id": "3c58a493-6d15-4b90-bc5a-154d6f6d6474",
              "name": "country code",
              "type": "string",
              "value": "={{ $json['country code'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "72f54c66-32df-45a4-8b1d-84a02cc7c4b8",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        400
      ],
      "parameters": {
        "color": 4,
        "width": 340,
        "height": 320,
        "content": "- Map keyword and country code \n- Update the Zone name to match your zone on Bright Data\n- Run the scraper"
      },
      "typeVersion": 1
    },
    {
      "id": "49eb27cd-0ced-498d-a85e-92c0928847a4",
      "name": "Map out keyword",
      "type": "n8n-nodes-base.set",
      "position": [
        -576,
        464
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4a5b9b7c-184e-4269-bee1-36684b1c99fc",
              "name": "titlesDescriptions",
              "type": "array",
              "value": "={{ $json.organic.map(item => ({ title: item.title, description: item.description })) }}"
            },
            {
              "id": "27ae3f27-d185-4ef0-8aaa-7e65c87fa6f2",
              "name": "paaQuestions",
              "type": "array",
              "value": "={{ $json.people_also_ask.map(item => item.question )}}"
            },
            {
              "id": "cd6102fa-8c47-44ca-b302-53b52dcaeb4f",
              "name": "search_term",
              "type": "string",
              "value": "={{ $('set keyword').item.json.search_term }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ae34e2d9-17ec-4013-a1cc-1ed7b1adfcae",
      "name": "无操作,不执行任何操作1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -784,
        784
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "set keyword": {
      "main": [
        [
          {
            "node": "Fetch Google Search Results JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Keywords": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "meta structure": {
      "main": [
        [
          {
            "node": "Create new meta and Structure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "set keyword",
            "type": "main",
            "index": 0
          },
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map out keyword": {
      "main": [
        [
          {
            "node": "Generate New title and metadescriptins",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate New title and metadescriptins",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Generate New title and metadescriptins",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Google Search Results JSON": {
      "main": [
        [
          {
            "node": "Map out keyword",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate New title and metadescriptins": {
      "main": [
        [
          {
            "node": "meta structure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研, 多模态 AI

需要付费吗?

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

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

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

作者
Zacharia Kimotho

Zacharia Kimotho

@imperolq

Automation expert with years of experience helping businesses improve their efficiency and productivity with smart automations that are affordable, scalable, and flexible.

外部链接
在 n8n.io 查看

分享此工作流