Génération de commentaires de produits réels pour WooCommerce avec OpenAI
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 7 nœuds.Utilise principalement des nœuds comme Set, HttpRequest, ManualTrigger, OpenAi. Utiliser OpenAI pour générer des avis de produits réels pour WooCommerce
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Clé API OpenAI
Nœuds utilisés (7)
Catégorie
{
"meta": {
"instanceId": "8e39b7468c6828f4a107b01649bad86d436b5b7484be7eb792fe15ba099d5821"
},
"nodes": [
{
"id": "37f90234-8233-495a-b9e5-394de7c76852",
"name": "Lors du clic sur 'Exécuter le workflow'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
-624
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f91ce677-4b08-43f7-b742-a54f9c48e07c",
"name": "Note autocollante",
"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": "Récupérer les produits depuis 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": "Construire l'invite de commentaire produit",
"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": "Générer le commentaire produit (IA)",
"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": "Extraire la sortie IA",
"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": "Publier l'avis sur le produit",
"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
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Ali Khosravani
@alikhosroAutomation & 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.
Partager ce workflow