8
n8n 中文网amn8n.com

AI驱动的WooCommerce产品导入器与SEO

高级

这是一个Sales, AI领域的自动化工作流,包含 16 个节点。主要使用 Code, Telegram, WooCommerce, GoogleSheets, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 基于Google表格的AI驱动WooCommerce产品导入器,含Yoast SEO元数据

前置要求
  • Telegram Bot Token
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "YkATyvsBXigxnMgo",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
    "templateCredsSetupCompleted": true
  },
  "name": "AI 驱动的 WooCommerce 产品导入器与 SEO",
  "tags": [],
  "nodes": [
    {
      "id": "aa2d7a06-6e8d-4abc-ab5f-53e9698b1655",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -360,
        -340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1f2465ab-90fa-44f1-8c06-58b1436dccd0",
      "name": "OpenRouter 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        180,
        160
      ],
      "parameters": {
        "model": "google/gemini-2.0-flash-exp:free",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "pb06rfB4xmxzVe3Q",
          "name": "OpenRouter"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "29832953-a3e1-481d-a8bb-238bbf3c736c",
      "name": "SEO 专家",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        200,
        -60
      ],
      "parameters": {
        "text": "=Create metatitle and metadescription in the language of the following product:\n\n- Title: {{ $('Create product').item.json.name }}\n- Category: {{ JSON.stringify($('Create product').item.json.categories) }}\n- Short Description: {{ $('Create product').item.json.short_description }}\n- Description: {{ $('Create product').item.json.description }}",
        "messages": {
          "messageValues": [
            {
              "message": "=You are a SEO expert specialized in creating optimized meta tags. Your task is to analyze the provided content and generate:\n\n1. A meta title of maximum 60 characters that:\n   - Includes the main keyword in a strategic position\n   - Is engaging and encourages clicks\n   - Accurately reflects the page content\n   - Uses clear and direct language\n   - Avoids keyword stuffing\n\n2. A meta description of maximum 160 characters that:\n   - Provides an engaging summary of the content\n   - Includes an appropriate call-to-action\n   - Contains the main keyword and relevant variations\n   - Is grammatically correct and flows well\n   - Maintains consistency with the meta title\n\nANALYSIS PROCESS:\n1. Carefully read the provided content\n2. Identify:\n   - Main topic\n   - Primary and related keywords\n   - Search intent\n   - Unique selling proposition\n   - Target audience\n\n3. Formulate meta tags that:\n   - Maximize CTR\n   - Respect character limits\n   - Are SEO optimized\n   - Reflect the content\n   - Don't insert placeholder\n\nREQUIRED OUTPUT:\nProvide meta tags in the required format\n\nVALIDATION CRITERIA:\n- Verify that the meta title doesn't exceed 60 characters\n- Verify that the meta description doesn't exceed 160 characters\n- Check that both contain the main keyword\n- Ensure the language is persuasive and action-oriented\n- Confirm that meta tags are consistent with the content\n\nIMPORTANT:\n- Don't use excessive punctuation\n- Avoid using special characters unless necessary\n- Don't duplicate information between title and description\n- Maintain a professional yet accessible tone\n- Ensure content is unique and not duplicated\n\nRemember: the goal is to create meta tags that effectively balance SEO optimization and user appeal, maximizing the potential click-through rate in search results."
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "e61c4d07-e535-404d-a58e-1676e043d1cb",
      "name": "获取产品",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -120,
        -340
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": false
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "DONE"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4/edit?usp=drivesdk",
          "cachedResultName": "Create WooCommerce products"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "a3ca44a3-a270-4339-aae0-5e7963a9d695",
      "name": "映射分类",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        -320
      ],
      "parameters": {
        "jsCode": "for (const item of $input.all()) {\n  if (item.json.CATEGORY && typeof item.json.CATEGORY === 'string') {\n    item.json.CATEGORY = item.json.CATEGORY\n      .split(',')\n      .map(id => parseInt(id))\n      .filter(id => !isNaN(id));\n  }\n}\n\nreturn $input.all();\n"
      },
      "typeVersion": 2
    },
    {
      "id": "fe36f50a-1197-4f8a-a02f-70687e5049c8",
      "name": "创建产品",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        680,
        -320
      ],
      "parameters": {
        "name": "={{ $json.TITLE }}",
        "imagesUi": {
          "imagesValues": [
            {
              "alt": "={{ $json.TITLE }}",
              "src": "={{ $json.IMAGE }}",
              "name": "={{ $json.TITLE }}"
            }
          ]
        },
        "resource": "product",
        "operation": "create",
        "metadataUi": {},
        "dimensionsUi": {},
        "additionalFields": {
          "sku": "={{ $json.SKU }}",
          "type": "simple",
          "salePrice": "={{ $json[\"SALE PRICE\"] }}",
          "taxStatus": "taxable",
          "categories": "={{ $json.CATEGORY }}",
          "description": "={{ $json.DESCRIPTION }}",
          "manageStock": true,
          "stockStatus": "instock",
          "regularPrice": "={{ $json[\"REGULAR PRICE\"] }}",
          "stockQuantity": "={{ $json[\"STOCK QTY\"] }}",
          "shortDescription": "={{ $json[\"SHORT DESCRIPTION\"] }}",
          "catalogVisibility": "visible"
        }
      },
      "credentials": {
        "wooCommerceApi": {
          "id": "vYYrjB5kgHQ0XByZ",
          "name": "WooCommerce (wp.test.7hype.com)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5f70ca85-45c0-483e-ae01-364d5fedb9f8",
      "name": "创建完成",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        940,
        -320
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $json.id }}",
            "DONE": "x",
            "PERMALINK": "={{ $json.permalink }}",
            "row_number": "={{ $('Map categories').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "TITLE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "TITLE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CATEGORY",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CATEGORY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "IMAGE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "IMAGE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SKU",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "SKU",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "REGULAR PRICE",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "REGULAR PRICE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SALE PRICE",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "SALE PRICE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SHORT DESCRIPTION",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "SHORT DESCRIPTION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DESCRIPTION",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "DESCRIPTION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "STOCK QTY",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "STOCK QTY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DONE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DONE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "PERMALINK",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "PERMALINK",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10k_dyLEnoFqDcKMHDrr1LwRSnQGgOrXGZCZQmf76fRU/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4/edit?usp=drivesdk",
          "cachedResultName": "Create WooCommerce products"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "de6904d1-5697-4fee-8492-e47a694e86c9",
      "name": "更新元数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        920,
        -60
      ],
      "parameters": {
        "columns": {
          "value": {
            "METATITLE": "={{ $('SEO Expert').item.json.output.metatitle }}",
            "row_number": "={{ $('Map categories').item.json.row_number }}",
            "METADESCRIPTION": "={{ $('SEO Expert').item.json.output.metadescription }}"
          },
          "schema": [
            {
              "id": "TITLE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "TITLE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CATEGORY",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "CATEGORY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "IMAGE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "IMAGE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SKU",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SKU",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "REGULAR PRICE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "REGULAR PRICE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SALE PRICE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SALE PRICE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SHORT DESCRIPTION",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SHORT DESCRIPTION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DESCRIPTION",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DESCRIPTION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "STOCK QTY",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "STOCK QTY",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DONE",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "DONE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "PERMALINK",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "PERMALINK",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "METATITLE",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "METATITLE",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "METADESCRIPTION",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "METADESCRIPTION",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4/edit#gid=0",
          "cachedResultName": "Foglio1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1vNkSgWHsgYDCusD-xKSrQg64hd7WvOjQmqdB2NdVFG4/edit?usp=drivesdk",
          "cachedResultName": "Create WooCommerce products"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "JYR6a64Qecd6t8Hb",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "f9f0eb06-3d76-4675-af0a-8ec9b3811b79",
      "name": "设置 SEO 元数据",
      "type": "n8n-nodes-base.wooCommerce",
      "position": [
        600,
        -60
      ],
      "parameters": {
        "imagesUi": {},
        "resource": "product",
        "operation": "update",
        "productId": "={{ $('Create product').item.json.id }}",
        "metadataUi": {
          "metadataValues": [
            {
              "key": "_yoast_wpseo_title",
              "value": "={{ $json.output.metatitle }}"
            },
            {
              "key": "_yoast_wpseo_metadesc",
              "value": "={{ $json.output.metadescription }}"
            }
          ]
        },
        "dimensionsUi": {},
        "updateFields": {}
      },
      "credentials": {
        "wooCommerceApi": {
          "id": "vYYrjB5kgHQ0XByZ",
          "name": "WooCommerce (wp.test.7hype.com)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0ae1b508-9990-4f7b-bf64-e612ef5f0396",
      "name": "循环产品",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        120,
        -340
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "e713e1cd-b0cc-465d-971a-54a8002e0c39",
      "name": "发送消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        400,
        -500
      ],
      "webhookId": "9647e7ef-d449-40ff-a34d-9853e4404595",
      "parameters": {
        "text": "Product creation completed",
        "chatId": "CHAT_ID",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "rQ5q95W7uKesMDx4",
          "name": "Telegram account Fastewb"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "06228035-8e02-4830-bf54-23096e6e1ca7",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        440,
        160
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"metatitle\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"metadescription\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c46b05a5-a565-48fe-a8ad-fad34eab267c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        -1060
      ],
      "parameters": {
        "width": 800,
        "height": 480,
        "content": "## 步骤 1"
      },
      "typeVersion": 1
    },
    {
      "id": "5cde4743-f5ab-4670-b836-d0d32b54db98",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -840
      ],
      "parameters": {
        "width": 800,
        "height": 260,
        "content": "## 步骤 3"
      },
      "typeVersion": 1
    },
    {
      "id": "cea0f8f9-2a98-465b-925c-48b9d3ea99a2",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -1060
      ],
      "parameters": {
        "width": 800,
        "height": 180,
        "content": "## 步骤 2"
      },
      "typeVersion": 1
    },
    {
      "id": "e61ca71a-3960-49e2-a331-b8f3df8abcd7",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        -1280
      ],
      "parameters": {
        "color": 3,
        "width": 1640,
        "height": 180,
        "content": "# AI 驱动的 WooCommerce 产品导入器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b9e5c366-9c92-4c7d-a5aa-ee2957c94f66",
  "connections": {
    "SEO Expert": {
      "main": [
        [
          {
            "node": "Set SEO meta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update meta": {
      "main": [
        [
          {
            "node": "Loop products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get products": {
      "main": [
        [
          {
            "node": "Loop products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set SEO meta": {
      "main": [
        [
          {
            "node": "Update meta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creation done": {
      "main": [
        [
          {
            "node": "SEO Expert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop products": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Map categories",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create product": {
      "main": [
        [
          {
            "node": "Creation done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map categories": {
      "main": [
        [
          {
            "node": "Create product",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "SEO Expert",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "SEO Expert",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 销售, 人工智能

需要付费吗?

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

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

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

作者

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at info@n3w.it or add me on Linkedin.com/in/davideboizza

外部链接
在 n8n.io 查看

分享此工作流