8
n8n 中文网amn8n.com

使用 Gemini、Tavily 和人工审核生成 SEO 优化 WordPress 博客

高级

这是一个Content Creation, Miscellaneous, Multimodal AI领域的自动化工作流,包含 38 个节点。主要使用 If, Set, Code, Telegram, Aggregate 等节点。 使用 Gemini、Tavily 和人工审核生成 SEO 优化 WordPress 博客

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "58a9e858b82757a75629d435ec0da2448ad5d9e906a9ce3b7dcbb64c90fda9fe",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e747e3a1-c579-45cf-90a3-ce1eca7bcbcd",
      "name": "创建帖子",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        4224,
        3048
      ],
      "parameters": {
        "title": "={{ $('Structure Post Content').item.json.title }}",
        "additionalFields": {
          "tags": [],
          "status": "publish",
          "content": "={{ $('Structure Post Content').item.json.content }}",
          "categories": "={{ \n  $('Structure Selected Post').item.json.categories\n    .filter(i => i.name === $('Structure Post Content').item.json.categoryName)\n    .map(i => i.id)\n}}",
          "postTemplate": {
            "values": {}
          }
        }
      },
      "credentials": {
        "wordpressApi": {
          "id": "yuyRIMiq4Zxnq538",
          "name": "Wordpress account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a7b69718-35eb-407d-af24-8353aa262d49",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        384,
        3048
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 4,
              "triggerAtHour": 20
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c6ca0aa3-bd60-44d9-8915-9e9b038837cc",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        616,
        3272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "GrbWNcmNxQFQaJje",
          "name": "Gemini API n8n-automation"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "10e96f6d-ffa9-4931-99d5-3f239ebeafce",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        744,
        3272
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"topic\": \"catchy blog topic idea\",\n  \"search_query\": \"short Tavily-friendly query under 350 characters\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "393f36da-77d1-4691-bed5-645823c65875",
      "name": "Google Gemini 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2760,
        3272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "GrbWNcmNxQFQaJje",
          "name": "Gemini API n8n-automation"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d4bcb587-56fd-4a16-8da7-1e1e34fc505f",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2888,
        3272
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"title\": \"SEO optimized blog title\",\n  \"excerpt\": \"Short meta description for SEO\",\n  \"keywords\": [\"keyword1\", \"keyword2\", \"keyword3\"],\n  \"image_prompt\": \"A descriptive prompt for generating a featured image\",\n  \"isExistingCategory\": true,\n  \"categoryName\": \"Selected or newly created category\",\n  \"content\": \"<h2>Heading</h2><p>Blog content in clean HTML format...</p>\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "d84285a1-5794-4e5b-971b-7e129a81ec29",
      "name": "上传媒体到Wordpress",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4000,
        3048
      ],
      "parameters": {
        "url": "https://devally.in/wp-json/wp/v2/media",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "binaryData",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "content-disposition",
              "value": "=attachment; filename={{ $binary.data.fileName }}.{{ $binary.data.fileExtension }}"
            },
            {
              "name": "content-type",
              "value": "={{ $binary.data.mimeType }}"
            }
          ]
        },
        "inputDataFieldName": "data",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e2e139fd-1d9e-4f0d-afca-ab6bb6660702",
      "name": "获取现有分类",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2080,
        3048
      ],
      "parameters": {
        "url": "https://devally.in/wp-json/wp/v2/categories",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2110baac-ad2a-439a-9676-1bfc87e89e80",
      "name": "如果1",
      "type": "n8n-nodes-base.if",
      "position": [
        3328,
        3048
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "233aba38-a10c-4a89-b607-aa8a64e6b33b",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.isExistingCategory }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e0d9bc92-c6c0-4b42-a238-a27447b521aa",
      "name": "在Wordpress中创建分类",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3552,
        3120
      ],
      "parameters": {
        "url": "https://devally.in/wp-json/wp/v2/categories",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $json.categoryName }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "68a44727-00d0-4ffd-b11a-8d4554f4c9e5",
      "name": "获取主题文章",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        2976
      ],
      "parameters": {
        "url": "https://api.tavily.com/search",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.output.search_query }}"
            },
            {
              "name": "max_results",
              "value": "4"
            },
            {
              "name": "time_range",
              "value": "week"
            },
            {
              "name": "include_raw_content",
              "value": "text"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer tvly-dev-1234567"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "65f4b4e2-2a9b-4c6a-ad82-b53b07b684e8",
      "name": "URL提取器",
      "type": "n8n-nodes-base.code",
      "position": [
        1408,
        2976
      ],
      "parameters": {
        "jsCode": "const results = $input.first().json.results;\n\nconst urls = results.map(item => item.url);\n\nreturn { urls };"
      },
      "typeVersion": 2
    },
    {
      "id": "0e5e2dd1-3b7a-4172-ba3b-009582d723b2",
      "name": "确认要确认的文章",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1632,
        2976
      ],
      "webhookId": "c7b7352e-0736-4c56-be6d-0f282045326c",
      "parameters": {
        "chatId": "-1002717091868",
        "message": "=Please select the article to be finalized.\n\nArticles:\n{{ $json.urls.map((url, index) => \"- \" + (index+1) + \" - \" + url).join(\"\\n\") }}",
        "options": {
          "messageButtonLabel": "Finalize Article"
        },
        "operation": "sendAndWait",
        "formFields": {
          "values": [
            {
              "fieldType": "dropdown",
              "fieldLabel": "Which article should be finalized? (Select the Article Number)",
              "fieldOptions": {
                "values": [
                  {
                    "option": "1"
                  },
                  {
                    "option": "2"
                  },
                  {
                    "option": "3"
                  },
                  {
                    "option": "4"
                  },
                  {
                    "option": "None"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "responseType": "customForm"
      },
      "credentials": {
        "telegramApi": {
          "id": "0WxaSezxTdjULejN",
          "name": "DevAlly"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "59b363e1-65cf-4de3-8195-4a8eb5348afe",
      "name": "如果文章不为空",
      "type": "n8n-nodes-base.if",
      "position": [
        1856,
        3048
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0db5e8f2-565d-4ca0-a68a-3be3d264d83b",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.data['Which article should be finalized? (Select the Article Number)'] }}",
              "rightValue": "None"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8207e110-6077-4df9-b8e3-2aba2956b8b5",
      "name": "聚合分类",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2304,
        3048
      ],
      "parameters": {
        "include": "specifiedFields",
        "options": {},
        "aggregate": "aggregateAllItemData",
        "fieldsToInclude": "id, name"
      },
      "typeVersion": 1
    },
    {
      "id": "7b9cd83a-8cfd-4db9-a336-9fede02362d1",
      "name": "使用Gemini生成图像",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        3776,
        3048
      ],
      "parameters": {
        "prompt": "={{ $json.image_prompt }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/imagen-4.0-generate-001",
          "cachedResultName": "models/imagen-4.0-generate-001"
        },
        "options": {},
        "resource": "image"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "GrbWNcmNxQFQaJje",
          "name": "Gemini API n8n-automation"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8bd77619-d80c-4bb7-9c9e-4304b2b7d346",
      "name": "使用OpenAI生成图像",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3776,
        2816
      ],
      "parameters": {
        "prompt": "={{ $json.image_prompt }}",
        "options": {
          "size": "1792x1024",
          "style": "vivid",
          "dalleQuality": "standard"
        },
        "resource": "image"
      },
      "credentials": {
        "openAiApi": {
          "id": "7OVQwPA6RZRwFmwI",
          "name": "OpenAI Account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "d15e4afe-9d26-4ecb-a301-a86a841ef5c6",
      "name": "最终Telegram消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        5792,
        3048
      ],
      "webhookId": "49fc260c-37f8-4b04-a618-3705c4709452",
      "parameters": {
        "text": "=Posted the Blog on \"{{ $json.Title }}\"\nCategory - {{ $json.Category }}\nLink - {{ $json.Link }}\n\nView on Google Sheets -\nhttps://docs.google.com/spreadsheets/d/1aaSBeDXtU9n4wmgoH-mn3ett54vCDCMwxzlyhJCiPqA/edit?usp=sharing\n\n{{ $json.Timestamp }}",
        "chatId": "-1002717091868",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "0WxaSezxTdjULejN",
          "name": "DevAlly"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5745c673-75ce-4b52-9722-a11430b9dc31",
      "name": "更改作者",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4896,
        3048
      ],
      "parameters": {
        "url": "=https://devally.in/wp-json/wp/v2/posts/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "author",
              "value": "1"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f1f2a2d1-2ccf-4b3f-9945-57920beba6bf",
      "name": "在文章上添加摘要",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4448,
        3048
      ],
      "parameters": {
        "url": "=https://devally.in/wp-json/wp/v2/posts/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "excerpt",
              "value": "={{ $('Structure Post Content').first().json.excerpt }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7cc5bf92-cb01-49a9-b81d-aeac023c708a",
      "name": "在文章上添加特色媒体",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4672,
        3048
      ],
      "parameters": {
        "url": "=https://devally.in/wp-json/wp/v2/posts/{{ $json.id }}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "featured_media",
              "value": "={{ $('Upload Media to Wordpress').item.json.id }}"
            }
          ]
        },
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2b1d872b-ac15-4d09-9878-121b6f0ace6c",
      "name": "获取格式化日期和时间",
      "type": "n8n-nodes-base.code",
      "position": [
        5120,
        3048
      ],
      "parameters": {
        "jsCode": "const now = new Date();\nconst istNow = new Date(now.toLocaleString(\"en-US\", { timeZone: \"Asia/Kolkata\" }));\nconst date = istNow.toLocaleDateString(\"en-IN\", { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });\nconst time = istNow.toLocaleTimeString(\"en-IN\", { hour: '2-digit', minute: '2-digit', hour12: true });\n\nreturn [{\n  json: {\n    formatted: `${date}, ${time} (IST)`\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "37f5fa97-b4b4-4f5b-aff1-e0dc91a440ed",
      "name": "文章内容结构",
      "type": "n8n-nodes-base.set",
      "position": [
        5344,
        3048
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e1175ea6-28d7-4f65-a7ec-8d96b54ac5ee",
              "name": "slug",
              "type": "string",
              "value": "={{ $('Create a post').item.json.slug }}"
            },
            {
              "id": "3930a46b-d12f-40d2-9322-87b5584ffc82",
              "name": "link",
              "type": "string",
              "value": "={{ $('Create a post').item.json.link }}"
            },
            {
              "id": "3dfa5ddb-25da-4db7-bba0-285bca546ffc",
              "name": "source_url",
              "type": "string",
              "value": "={{ $('Upload Media to Wordpress').item.json.source_url }}"
            },
            {
              "id": "89706a1a-09a4-4cee-85cc-36be3f86134c",
              "name": "categoryName",
              "type": "string",
              "value": "={{ $('If1').item.json.categoryName }}"
            },
            {
              "id": "97c78752-b4bf-4d52-95bb-d12af676f320",
              "name": "timestamp",
              "type": "string",
              "value": "={{ $json.formatted }}"
            },
            {
              "id": "2de0d9b1-743e-4dac-9a6f-b017546a7b6c",
              "name": "title",
              "type": "string",
              "value": "={{ $('Create a post').item.json.title.rendered }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c6c4f627-a4ea-47c4-ad60-a6b0922e54f4",
      "name": "在表格中追加文章数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5568,
        3048
      ],
      "parameters": {
        "columns": {
          "value": {
            "Link": "={{ $json.link }}",
            "Slug": "={{ $json.slug }}",
            "Title": "={{ $json.title}}",
            "Category": "={{ $json.categoryName }}",
            "Timestamp": "={{ $json.timestamp }}",
            "Featured Image": "={{ $json.source_url }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Featured Image",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Featured Image",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Slug",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Slug",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 958859474,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aaSBeDXtU9n4wmgoH-mn3ett54vCDCMwxzlyhJCiPqA/edit#gid=958859474",
          "cachedResultName": "Blogs Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1aaSBeDXtU9n4wmgoH-mn3ett54vCDCMwxzlyhJCiPqA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1aaSBeDXtU9n4wmgoH-mn3ett54vCDCMwxzlyhJCiPqA/edit?usp=drivesdk",
          "cachedResultName": "Auto Blogging (DevAlly)"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Gs7mfT220sbLQ7PS",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1c0e6c33-af52-49b7-b360-c6a3e0b9a2f3",
      "name": "使用LLM生成主题",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        608,
        3048
      ],
      "parameters": {
        "text": "=Generate one blog topic idea based on the latest tech trends, updates, or common mistakes \nthat would attract readers to our agency blog. \nMake sure the topic is related to one of our services:\n- Web Development (Next.js, React, WordPress, performance optimization)\n- Mobile App Development (Flutter, React Native, Android, iOS)\n- Cloud & DevOps (AWS, Azure, CI/CD, serverless)\n- UI/UX Design (Figma, prototyping, accessibility)\n- AI & Automation for Businesses (chatbots, workflow automation, AI in SaaS)\n- Digital Transformation & IT Consulting (enterprise adoption, case studies)\n\nRequirements:\n- The topic must be engaging for both tech and non-tech readers.\n- The search query must be Tavily-friendly and under 350 characters.\n- Focus on fresh, trending, or news-related ideas, not outdated content.\n- Output ONLY valid JSON.\n\nOutput format:\n{\n  \"topic\": \"catchy blog topic idea\",\n  \"search_query\": \"short Tavily-friendly query under 350 characters\"\n}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are a digital strategist and content researcher for a tech agency. \nYour task is to suggest trending and engaging blog topics aligned with our services, \nand generate a Tavily search query that will retrieve the latest articles on that trend. \nAlways return valid JSON."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "60b4ff17-a30a-4356-8b11-3092bee18c9a",
      "name": "撰写文章内容",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2752,
        3048
      ],
      "parameters": {
        "text": "=Here is the article content from Tavily that I want you to regenerate into a proper blog post:\n\nTitle:\n{{ $json.selected_article.title }}\n\nContent:\n{{ $json.selected_article.content }}\n\nPlease rewrite this into polished, factually accurate, SEO-optimized blog content following the system instructions.\n\nHere is the list of existing categories you can choose from:\n{{ $json.category_names }}\n\nIf the article doesn’t fit any of these, create a new category name.\n",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are an expert technical content writer for a digital agency blog. \nYour job is to take an input article and regenerate it into a polished, engaging, factually correct, SEO-friendly blog post. \nYou must keep the writing style attractive, accessible, and useful for readers (both tech and non-tech audiences).\n\nFormatting & Output Rules:\n- The blog body must be formatted in clean HTML (only headings, paragraphs, lists, links, emphasis, etc.).\n- Do not include <html>, <head>, or <body> wrappers. Only output the content section.\n- Optimize readability with headings (<h2>, <h3>), short paragraphs, bullet points, and examples.\n- Ensure the content remains fact-based and reflects real, accurate, up-to-date information.\n- Improve SEO by naturally including relevant keywords (without stuffing).\n- Write in a professional yet friendly tone that reflects thought leadership.\n\nExtra Requirements:\n- Create a strong SEO-optimized title.\n- Generate a concise excerpt (meta description, max 160 characters).\n- Suggest a creative and descriptive image prompt for a featured image (suitable for AI image generation).\n- Suggest 5–8 SEO keywords related to the article.\n- Choose the most appropriate blog category from the given list of categories. \n  - If a category from the list fits, return it and set isExistingCategory to true.\n  - If none fit, create a new category name and set isExistingCategory to false.\n\nFinal Output:\nReturn everything strictly as JSON in the following format:\n{\n  \"title\": \"SEO optimized blog title\",\n  \"excerpt\": \"Short meta description for SEO\",\n  \"keywords\": [\"keyword1\", \"keyword2\", \"keyword3\"],\n  \"image_prompt\": \"A descriptive prompt for generating a featured image\",\n  \"isExistingCategory\": true,\n  \"categoryName\": \"Selected or newly created category\",\n  \"content\": \"<h2>Heading</h2><p>Blog content in clean HTML format...</p>\"\n}"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 1.7
    },
    {
      "id": "c1dcd79d-6bf9-4126-82b9-742ae9f152af",
      "name": "结构化选定的文章",
      "type": "n8n-nodes-base.set",
      "position": [
        2528,
        3048
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b7b81f9c-e613-4da6-9c5a-af4b198f7cb1",
              "name": "selected_article",
              "type": "object",
              "value": "={{ $('Structure Tavily Results').item.json.results[ $('If Article Not None').item.json.data['Which article should be finalized? (Select the Article Number)']-1] }}"
            },
            {
              "id": "603edf55-1303-4efe-9651-1cae6f7fed0f",
              "name": "categories",
              "type": "array",
              "value": "={{ $json.data }}"
            },
            {
              "id": "e3062b34-8ea6-4e49-8db3-80340ae40cb5",
              "name": "category_names",
              "type": "string",
              "value": "={{ $json.data.map(i => i.name).join(\", \") }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d2dece02-38e4-412b-bd41-dce313b35183",
      "name": "结构化Tavily结果",
      "type": "n8n-nodes-base.set",
      "position": [
        1184,
        2976
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fce26099-b752-44e7-9278-f46a80c11593",
              "name": "results",
              "type": "array",
              "value": "={{ $json.results }}"
            },
            {
              "id": "825bfb3d-18c8-48aa-ade1-0cfb3d909149",
              "name": "query",
              "type": "string",
              "value": "={{ $json.query }}"
            },
            {
              "id": "ae64d6d8-7dc8-4bd0-91ce-d532cc0dd14a",
              "name": "request_id",
              "type": "string",
              "value": "={{ $json.request_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "921c88fe-1d56-4fae-8cb9-55ba325a1ea5",
      "name": "结构化文章内容",
      "type": "n8n-nodes-base.set",
      "position": [
        3104,
        3048
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "eb24cd37-0683-40a4-900f-190c641bc088",
              "name": "title",
              "type": "string",
              "value": "={{ $json.output.title }}"
            },
            {
              "id": "718a4280-222e-4afb-88d0-e48cc5b78466",
              "name": "excerpt",
              "type": "string",
              "value": "={{ $json.output.excerpt }}"
            },
            {
              "id": "409c349e-e19f-43b5-99c3-74a2bec36570",
              "name": "keywords",
              "type": "array",
              "value": "={{ $json.output.keywords }}"
            },
            {
              "id": "50af352e-86e6-4f0b-92e9-5b2ecb22ab18",
              "name": "image_prompt",
              "type": "string",
              "value": "={{ $json.output.image_prompt }}"
            },
            {
              "id": "a53d7bd9-f909-4c58-ba91-0f21772886d4",
              "name": "content",
              "type": "string",
              "value": "={{ $json.output.content }}"
            },
            {
              "id": "f1a2355d-bae0-42df-98ac-346472d50049",
              "name": "isExistingCategory",
              "type": "boolean",
              "value": "={{ $json.output.isExistingCategory }}"
            },
            {
              "id": "68a8a296-4ab7-4e95-8647-e0a7ba91ce7c",
              "name": "categoryName",
              "type": "string",
              "value": "={{ $json.output.categoryName }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4b120cc5-79a6-436d-af9a-4a1133be97d6",
      "name": "获取所有用户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4896,
        2832
      ],
      "parameters": {
        "url": "https://devally.in/wp-json/wp/v2/users",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "wordpressApi"
      },
      "credentials": {
        "wordpressApi": {
          "id": "UyfbTTKctTIA1rEx",
          "name": "Wordpress account 2"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c0c4928b-c9e5-4263-845c-26bfe3a3fa34",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        2912
      ],
      "parameters": {
        "color": 4,
        "width": 464,
        "height": 400,
        "content": "## Wordpress自动博客系统"
      },
      "typeVersion": 1
    },
    {
      "id": "2dc43d23-9ee0-4acc-9c56-55df5cd9396f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        2720
      ],
      "parameters": {
        "width": 672,
        "height": 208,
        "content": "#### 主题生成"
      },
      "typeVersion": 1
    },
    {
      "id": "588909f8-e45b-4a5c-9c85-b418d96e46cf",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        2768
      ],
      "parameters": {
        "width": 368,
        "content": "#### Telegram确认"
      },
      "typeVersion": 1
    },
    {
      "id": "e67a4163-20c1-43a4-940d-e1b8fc6d68c9",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2368,
        2816
      ],
      "parameters": {
        "width": 480,
        "content": "### AI内容重写"
      },
      "typeVersion": 1
    },
    {
      "id": "5ff37c0b-5713-472f-82b4-4adf5dacdb53",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3392,
        2848
      ],
      "parameters": {
        "width": 336,
        "height": 96,
        "content": "### AI特色图像生成"
      },
      "typeVersion": 1
    },
    {
      "id": "1e9740b2-03ec-4a9b-a17b-5f6d62cadd74",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4256,
        2800
      ],
      "parameters": {
        "width": 528,
        "content": "### WordPress发布"
      },
      "typeVersion": 1
    },
    {
      "id": "678fbffe-6014-4505-afed-3e292cbbf122",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5504,
        2848
      ],
      "parameters": {
        "width": 400,
        "height": 144,
        "content": "### Telegram通知"
      },
      "typeVersion": 1
    },
    {
      "id": "01fb5fd8-8c53-48c7-824a-72ea469f2217",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        2352
      ],
      "parameters": {
        "color": 6,
        "width": 816,
        "height": 432,
        "content": "## 使用方法"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Generate an Image Gemini",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Category in Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a post": {
      "main": [
        [
          {
            "node": "Add Excerpt on the Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "URLs Extractor": {
      "main": [
        [
          {
            "node": "Confirm Article to Confirm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Generate the Topic using LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Change the Author": {
      "main": [
        [
          {
            "node": "Get Formatted Date & Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Article Not None": {
      "main": [
        [
          {
            "node": "Get Existing Categories",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate the Topic using LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Categories": {
      "main": [
        [
          {
            "node": "Structure Selected Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Final Telegram Message": {
      "main": [
        []
      ]
    },
    "Get Articles on Topics": {
      "main": [
        [
          {
            "node": "Structure Tavily Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Post Content": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Excerpt on the Post": {
      "main": [
        [
          {
            "node": "Add the Featured Media on Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Categories": {
      "main": [
        [
          {
            "node": "Aggregate Categories",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Selected Post": {
      "main": [
        [
          {
            "node": "Write Content for the Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an Image Gemini": {
      "main": [
        [
          {
            "node": "Upload Media to Wordpress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate an Image OpenAI": {
      "main": [
        []
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate the Topic using LLM",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structure Tavily Results": {
      "main": [
        [
          {
            "node": "URLs Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate the Topic using LLM",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get Formatted Date & Time": {
      "main": [
        [
          {
            "node": "Structure for the Post Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Write Content for the Post",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Write Content for the Post",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Upload Media to Wordpress": {
      "main": [
        [
          {
            "node": "Create a post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm Article to Confirm": {
      "main": [
        [
          {
            "node": "If Article Not None",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Content for the Post": {
      "main": [
        [
          {
            "node": "Structure Post Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Category in Wordpress": {
      "main": [
        [
          {
            "node": "Generate an Image Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate the Topic using LLM": {
      "main": [
        [
          {
            "node": "Get Articles on Topics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Post Data in the Sheet": {
      "main": [
        [
          {
            "node": "Final Telegram Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add the Featured Media on Post": {
      "main": [
        [
          {
            "node": "Change the Author",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure for the Post Content": {
      "main": [
        [
          {
            "node": "Append Post Data in the Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

工作流信息
难度等级
高级
节点数量38
分类3
节点类型15
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流