WooCommerce へ OpenAI 使用で実在の製品レビューを生成

中級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、7個のノードを含みます。主にSet, HttpRequest, ManualTrigger, OpenAiなどのノードを使用。 WooCommerce向けにOpenAIで本物の製品レビューを生成

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "8e39b7468c6828f4a107b01649bad86d436b5b7484be7eb792fe15ba099d5821"
  },
  "nodes": [
    {
      "id": "37f90234-8233-495a-b9e5-394de7c76852",
      "name": "「ワークフロー実行」クリック時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        -624
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f91ce677-4b08-43f7-b742-a54f9c48e07c",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -768
      ],
      "parameters": {
        "color": 2,
        "width": 1696,
        "height": 336,
        "content": "## Product AI Comment Generator\n\nThis workflow automatically generates short, natural-sounding product reviews using AI and posts them to your WooCommerce store. It fetches product data via the WooCommerce REST API, crafts a custom AI prompt for each product, and then submits the generated review as a product comment.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "512931cd-db6a-4056-b8bc-4705ea1f7877",
      "name": "WooCommerceから製品を取得",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 5,
      "position": [
        224,
        -624
      ],
      "parameters": {
        "url": "https://example.com/wp-json/wc/v3/products?per_page=100",
        "options": {
          "timeout": 600000,
          "batching": {
            "batch": {
              "batchSize": 100
            }
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "a390F9PA3LRvL5DR",
          "name": "YOUR_API_KEY"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 2000
    },
    {
      "id": "aef7c79c-96aa-4252-bd69-d2f83b773661",
      "name": "製品コメントプロンプトの構築",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        -624
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3af62c72-bd9b-433a-943c-4caafe23bdd5",
              "name": "prompt",
              "type": "string",
              "value": "=={{ `For the product “${$json.name}”, write a natural comment (one sentence). \nDescription: ${($json.short_description || $json.description || '').replace(/<[^>]*>/g,' ').slice(0,300)}` }}\nComment characteristics:\n- Some neutral, some positive, some negative, some questioning\n- Conversational tone, not formal\n- Occasionally include the brand name in the comment\n- Preferably short\n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "849160e7-9df1-4337-a111-65fc9bd8d5e5",
      "name": "製品コメントの生成(AI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        752,
        -624
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "={{$json.prompt}}\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "oETjE0hiLJ8SZxWX",
          "name": "YOUR_API_KEY"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1.8,
      "waitBetweenTries": 2000
    },
    {
      "id": "fb93ada6-17e2-46c8-8ca3-b24efcd67c97",
      "name": "AI出力の抽出",
      "type": "n8n-nodes-base.set",
      "position": [
        1104,
        -624
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "18fe84dc-59b3-440b-830d-da161cd5e3da",
              "name": "review",
              "type": "string",
              "value": "={{$json.message?.content || $json.choices?.[0]?.message?.content || $json.content}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3402a419-227b-446d-96dd-7e7bbc6eedd2",
      "name": "製品へのレビュー投稿",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 5,
      "position": [
        1360,
        -624
      ],
      "parameters": {
        "url": "https://example.com/wp-json/wc/v3/products/reviews",
        "method": "POST",
        "options": {
          "timeout": 900000
        },
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "product_id",
              "value": "={{ $('Fetch Products from WooCommerce').item.json.id }}"
            },
            {
              "name": "review",
              "value": "={{ $('Generate Product Comment (AI)').item.json.message.content }}"
            },
            {
              "name": "reviewer_email",
              "value": "={{ `guest+${$('Fetch Products from WooCommerce').item.json.id}-${Math.floor(Date.now()%100000)}@example.com`.toLowerCase() }}\n"
            },
            {
              "name": "reviewer",
              "value": "={{ (() => {\n  const first = ['John','Emily','Michael','Sophia','David','Olivia','Daniel','Ava','James','Isabella','Ethan','Mia','William','Charlotte','Benjamin','Amelia','Alexander','Harper','Lucas','Ella'];\n  const last  = ['Smith','Johnson','Williams','Brown','Jones','Garcia','Miller','Davis','Rodriguez','Martinez','Hernandez','Lopez','Gonzalez','Wilson','Anderson','Thomas','Taylor','Moore','Jackson','Martin'];\n  return `${first[Math.floor(Math.random()*first.length)]} ${last[Math.floor(Math.random()*last.length)]}`;\n})() }}\n"
            }
          ]
        },
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "a390F9PA3LRvL5DR",
          "name": "YOUR_API_KEY"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    }
  ],
  "pinData": {},
  "connections": {
    "fb93ada6-17e2-46c8-8ca3-b24efcd67c97": {
      "main": [
        [
          {
            "node": "3402a419-227b-446d-96dd-7e7bbc6eedd2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aef7c79c-96aa-4252-bd69-d2f83b773661": {
      "main": [
        [
          {
            "node": "849160e7-9df1-4337-a111-65fc9bd8d5e5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "849160e7-9df1-4337-a111-65fc9bd8d5e5": {
      "main": [
        [
          {
            "node": "fb93ada6-17e2-46c8-8ca3-b24efcd67c97",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "512931cd-db6a-4056-b8bc-4705ea1f7877": {
      "main": [
        [
          {
            "node": "aef7c79c-96aa-4252-bd69-d2f83b773661",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "37f90234-8233-495a-b9e5-394de7c76852": {
      "main": [
        [
          {
            "node": "512931cd-db6a-4056-b8bc-4705ea1f7877",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - コンテンツ作成, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

ワークフロー情報
難易度
中級
ノード数7
カテゴリー2
ノードタイプ5
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Ali Khosravani

Ali Khosravani

@alikhosro

Automation & SEO Specialist with years of experience building smart workflows, AI-powered content solutions, and marketing automations. Skilled in n8n, WordPress, and API integrations to help businesses save time and grow faster.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34