8
n8n 中文网amn8n.com

从Google Trends到WordPress

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 14 个节点。主要使用 Set, Code, Limit, Wordpress, SerpApi 等节点。 从Google Trends到WordPress的自动化博客内容生成(使用GPT-4o)

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Deax1GMBbSZll9IS",
  "meta": {
    "instanceId": "a28fa941f4dd50ba130162204d368b9dfd7d9b960d864f7ae0094ae8b516daa8",
    "templateCredsSetupCompleted": true
  },
  "name": "生成内容趋势",
  "tags": [],
  "nodes": [
    {
      "id": "9ed21af4-75ee-4552-aecf-4c7ef3675989",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -384,
        -112
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 20,
              "triggerAtMinute": 45
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "36436812-83f2-43ab-8d7b-99d32c1d1aa2",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1184,
        112
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "OLXWXsZdKGOvJr95",
          "name": "OpenAi test account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "41709e9e-f9ad-4d0b-a896-f45201f96983",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1392,
        112
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"title\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n      \"content\":{\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f4580fb6-93c0-4a97-92d6-05cbb27f41e6",
      "name": "创建帖子",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        1520,
        -112
      ],
      "parameters": {
        "title": "={{ $json.output.title }}",
        "additionalFields": {
          "status": "draft",
          "content": "={{ $json.output.content }}"
        }
      },
      "credentials": {
        "wordpressApi": {
          "id": "F7KQa1I6XnOv8Xty",
          "name": "WordpressMashhadMap"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7a97cd39-7279-4155-b3dd-3dd9d4fc6889",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -960
      ],
      "parameters": {
        "width": 736,
        "height": 816,
        "content": "# 从 Google Trends 到 WordPress 的自动化博客内容生成"
      },
      "typeVersion": 1
    },
    {
      "id": "0690742a-dc4b-4801-af92-304bdd72c141",
      "name": "设置目标国家",
      "type": "n8n-nodes-base.set",
      "position": [
        -176,
        -112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fbf9220c-ae51-4926-b2c1-3a46d621f1de",
              "name": "Country",
              "type": "string",
              "value": "IR"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d5ac170a-08bc-468f-891c-5a27e8e151b3",
      "name": "获取热门话题",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        48,
        -112
      ],
      "parameters": {
        "geo": "={{ $json.Country }}",
        "operation": "google_trends_trending_now",
        "requestOptions": {},
        "additionalFields": {}
      },
      "credentials": {
        "serpApi": {
          "id": "jJnSMvrdBo7DpKqp",
          "name": "SerpApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "281a59d5-31cd-4754-b73f-e2b80715b3bf",
      "name": "提取热门搜索",
      "type": "n8n-nodes-base.code",
      "position": [
        272,
        -112
      ],
      "parameters": {
        "jsCode": "return $input.first().json.trending_searches;"
      },
      "typeVersion": 2
    },
    {
      "id": "7e9bd949-872d-4af5-b73c-58bc841f0a37",
      "name": "限制为前 3 个趋势",
      "type": "n8n-nodes-base.limit",
      "position": [
        496,
        -112
      ],
      "parameters": {
        "maxItems": 3
      },
      "typeVersion": 1
    },
    {
      "id": "d90c7941-d9c1-4dc8-82bf-c07bcfeb2ab6",
      "name": "使用 AI 生成博客内容",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1168,
        -112
      ],
      "parameters": {
        "text": "=You are expert weblog writer.\nWrite a post about this content.\nThe information gathered from Google Trends and Google Search about a Trending topic.\nDon't mention the source of the information and the goal is to generate seo friendly content.\nUse the fact that exist in the search result.\n {{ $json.text }}",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "f6a9e1fd-70a3-4b41-8a09-f5c314734939",
      "name": "格式化搜索结果",
      "type": "n8n-nodes-base.code",
      "position": [
        944,
        -112
      ],
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  let text = `Google Search result for ${item.json.search_parameters.q}\\n`;\n  let i = 0;\n  for (const result of item.json.organic_results)\n    {\n      i++;\n  text += `Result ${i}\\n${result.title}\\n${result.snippet}\\n---`;    \n    }\n  item.json.text = text;\n  \n}\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "e96d2a99-e776-4db3-a05d-725d72db5f8a",
      "name": "搜索趋势详情",
      "type": "n8n-nodes-serpapi.serpApi",
      "position": [
        720,
        -112
      ],
      "parameters": {
        "q": "={{ $json.query }}",
        "requestOptions": {},
        "additionalFields": {}
      },
      "credentials": {
        "serpApi": {
          "id": "jJnSMvrdBo7DpKqp",
          "name": "SerpApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a7632715-1979-4f6b-9edf-04b241592911",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -224
      ],
      "parameters": {
        "color": 7,
        "height": 272,
        "content": "此节点对每个热门话题执行详细的 Google 搜索以收集全面信息"
      },
      "typeVersion": 1
    },
    {
      "id": "b41f0bf4-20bf-4b5e-ae17-a180c6059ecd",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -352
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 400,
        "content": "此代码节点处理并将 Google 搜索结果格式化为可读文本供 AI 使用:"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Asia/Tehran",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "cbaf59f3-b72a-4361-8ed7-8d202b602a15",
  "connections": {
    "f4580fb6-93c0-4a97-92d6-05cbb27f41e6": {
      "main": [
        []
      ]
    },
    "9ed21af4-75ee-4552-aecf-4c7ef3675989": {
      "main": [
        [
          {
            "node": "0690742a-dc4b-4801-af92-304bdd72c141",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "36436812-83f2-43ab-8d7b-99d32c1d1aa2": {
      "ai_languageModel": [
        [
          {
            "node": "d90c7941-d9c1-4dc8-82bf-c07bcfeb2ab6",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "0690742a-dc4b-4801-af92-304bdd72c141": {
      "main": [
        [
          {
            "node": "d5ac170a-08bc-468f-891c-5a27e8e151b3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e96d2a99-e776-4db3-a05d-725d72db5f8a": {
      "main": [
        [
          {
            "node": "f6a9e1fd-70a3-4b41-8a09-f5c314734939",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5ac170a-08bc-468f-891c-5a27e8e151b3": {
      "main": [
        [
          {
            "node": "281a59d5-31cd-4754-b73f-e2b80715b3bf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f6a9e1fd-70a3-4b41-8a09-f5c314734939": {
      "main": [
        [
          {
            "node": "d90c7941-d9c1-4dc8-82bf-c07bcfeb2ab6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7e9bd949-872d-4af5-b73c-58bc841f0a37": {
      "main": [
        [
          {
            "node": "e96d2a99-e776-4db3-a05d-725d72db5f8a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "41709e9e-f9ad-4d0b-a896-f45201f96983": {
      "ai_outputParser": [
        [
          {
            "node": "d90c7941-d9c1-4dc8-82bf-c07bcfeb2ab6",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "281a59d5-31cd-4754-b73f-e2b80715b3bf": {
      "main": [
        [
          {
            "node": "7e9bd949-872d-4af5-b73c-58bc841f0a37",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d90c7941-d9c1-4dc8-82bf-c07bcfeb2ab6": {
      "main": [
        [
          {
            "node": "f4580fb6-93c0-4a97-92d6-05cbb27f41e6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
IranServer.com

IranServer.com

@iranserver

Hosting, Virtual Server, Dedicated Server and Register Domain.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34