Adobe Commerce(Magento 2)自动化产品描述生成
中级
这是一个Miscellaneous, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 Set, Code, Merge, HttpRequest, ManualTrigger 等节点。 使用Azure OpenAI为Adobe Commerce/Magento自动生成产品描述
前置要求
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "LVoDtVFQ069sOYcC",
"meta": {
"instanceId": "965bb8e7bf93f91108971d05aa397ffa90b643c7ff8c03d51df51a28ffdc99dc",
"templateCredsSetupCompleted": true
},
"name": "Automated Product Description Generation for Adobe Commerce (Magento 2)",
"tags": [],
"nodes": [
{
"id": "7272f57f-3ebd-4a5d-a3ae-1c6a16e0a140",
"name": "When clicking ‘Test workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1504,
16
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1e10c1ee-3777-466e-ab0f-a211046f4114",
"name": "Save configurable",
"type": "n8n-nodes-base.httpRequest",
"position": [
64,
16
],
"parameters": {
"url": "=https://www.example.com/rest/V1/products/{{ encodeURIComponent($('get Product without description').first().json.items[0].sku) }}",
"method": "PUT",
"options": {},
"jsonBody": "={\n \"product\": {\n \"custom_attributes\": [{\n \"attribute_code\": \"description\",\n \"value\": \"{{ $json.description.replaceAll('\\n',' ').replaceAll('\"\"','\\\\\"') }}\"\n }]\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "magento2Api"
},
"credentials": {
"magento2Api": {
"id": "yGyqOmSuvrgMUFB9",
"name": "Magento 2 PROD"
}
},
"typeVersion": 4.2
},
{
"id": "5373fa9b-e857-435f-a3ae-08978e7717df",
"name": "set Description",
"type": "n8n-nodes-base.set",
"position": [
-128,
16
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c21f389d-4104-4a6f-b616-324abb221798",
"name": "description",
"type": "string",
"value": "={{ $json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e127791d-b564-4c23-86a2-a55cbe1bad49",
"name": "Basic LLM Chain",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-528,
16
],
"parameters": {
"text": "=Write an English product description based on this Magento2 attributes. Please use html paragraphs and breaks only. Ensure the text is grammatically correct, natural, and tailored to the ... market. Use terminology that is common in this sector, and avoid overly literal or informal style. \n\nWrite in a consistent style suitable for webshop product descriptions: professional, clear, and customer-oriented, while keeping a persuasive tone aimed at ...\n\nAdditionally, make the text SEO-friendly : include relevant keywords naturally without unnecessary repetition, and ensure the text reads smoothly while supporting search visibility.\n\nHere is the Magento product: {{ JSON.stringify($json) }}",
"batching": {},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "487315aa-572d-40a4-ba61-a091b8157061",
"name": "Azure OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
"position": [
-528,
192
],
"parameters": {
"model": "model-router",
"options": {}
},
"credentials": {
"azureOpenAiApi": {
"id": "Skyi4ZtQphRSSRSw",
"name": "Azure Open AI account 4"
}
},
"typeVersion": 1
},
{
"id": "5198d2bb-89db-401a-bf35-21884378c2f5",
"name": "Wait until nodes ready",
"type": "n8n-nodes-base.merge",
"position": [
-1040,
16
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "3807a3cf-d7aa-4315-8d25-cc6386b1181a",
"name": "get Product without description",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1264,
-128
],
"parameters": {
"url": "=https://www.example.com/rest/V1/products",
"options": {},
"sendQuery": true,
"authentication": "predefinedCredentialType",
"queryParameters": {
"parameters": [
{
"name": "searchCriteria[filter_groups][0][filters][0][field]",
"value": "description"
},
{
"name": "searchCriteria[filter_groups][0][filters][0][condition_type]",
"value": "null"
},
{
"name": "searchCriteria[pageSize]",
"value": "1"
}
]
},
"nodeCredentialType": "magento2Api"
},
"credentials": {
"magento2Api": {
"id": "yGyqOmSuvrgMUFB9",
"name": "Magento 2 PROD"
}
},
"typeVersion": 4.2
},
{
"id": "9c551919-8e15-44bb-937b-3ae06dc5ffc2",
"name": "Prepare attributes",
"type": "n8n-nodes-base.code",
"position": [
-720,
16
],
"parameters": {
"jsCode": "// Assuming the JSON data is stored in a variable called \"jsonData\"\nconst product = $(\"get Product without description\").first().json.items[0];\nconst data = $('Get attributes and options').first().json.items; // Extract the items containing attributes and options\nconst customAttributes = product.custom_attributes; // Extract the custom attributes\n//console.log(customAttributes);\n// Create a map of attribute_code to their options (for select-type attributes)\nconst attributeOptionsMap = {};\nfor (const attribute of data) {\n if (attribute.options) {\n attributeOptionsMap[attribute.attribute_code] = attribute.options;\n }\n}\n// Loop over all custom attributes to check if they exist in the attributeOptionsMap\nfor (const customAttribute of customAttributes) {\n const attributeCode = customAttribute.attribute_code;\n //console.log(attributeCode);\n\n // Check if this custom attribute exists in the attributeOptionsMap (i.e., it has options)\n if (attributeOptionsMap[attributeCode]) {\n \n const attributeOptions = attributeOptionsMap[attributeCode];\n const value = customAttribute.value;\n //console.log(value);\n\n // Find the label corresponding to the current value\n const matchingOption = attributeOptions.find(option => option.value === value);\n if (matchingOption) {\n // Replace the value with the label\n customAttribute.value = matchingOption.label;\n }\n }\n}\n// After this, customAttributes will have all applicable values replaced by their labels\nproduct.custom_attributes = customAttributes;\nreturn product;"
},
"typeVersion": 2
},
{
"id": "88d7173a-e816-4530-87e5-6be43f44b5b2",
"name": "Get attributes and options",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1264,
144
],
"parameters": {
"url": "https://www.example.com/rest/V1/products/attributes?searchCriteria[filter_groups][0][filters][0][field]=frontend_input&searchCriteria[filter_groups][0][filters][0][value]=select&fields=items[frontend_input,attribute_code,default_frontend_label,options]",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "magento2Api"
},
"credentials": {
"magento2Api": {
"id": "yGyqOmSuvrgMUFB9",
"name": "Magento 2 PROD"
}
},
"executeOnce": true,
"typeVersion": 4.2
},
{
"id": "50edd904-37c6-44cb-860c-023041f51892",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1552,
-336
],
"parameters": {
"color": 4,
"width": 720,
"height": 704,
"content": "### Step 1: Get Product Information from Magento\n- Retrieves a single product that is missing a description. \n- Reads all product attributes through the Magento API. "
},
"typeVersion": 1
},
{
"id": "7f7d74f8-2203-4268-a342-193b2c01eac9",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
-336
],
"parameters": {
"color": 6,
"width": 560,
"height": 704,
"content": "### Step 2: Generate Description with LLM\n- Resolves attribute options into **human-readable labels** (e.g. size = `3` → \"Large\"). \n- Prepares structured product data for use in the LLM prompt. \n- Passes the **readable product attributes** to an **Azure OpenAI** model. \n- Uses a defined **prompt** to instruct the LLM on how to write the description. \n- Produces a clear, engaging product description that can be tailored to brand or SEO needs. \n- Allows easy replacement of Azure OpenAI with any other LLM node in n8n. "
},
"typeVersion": 1
},
{
"id": "3eef5219-71a7-4409-a135-658c8fe42a5c",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-208,
-336
],
"parameters": {
"color": 2,
"width": 560,
"height": 704,
"content": "### Step 3: Save Product in Magento\n- Takes the generated description and updates the product via the **Magento 2 API**. \n- Ensures the new description is stored and visible on the webshop. \n- Supports updating other fields if desired (e.g. short description, meta description). \n- Confirms the product is enriched without requiring manual editing. "
},
"typeVersion": 1
},
{
"id": "62670ee5-58ad-45fc-b07e-f6d0885c4b98",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2464,
-336
],
"parameters": {
"width": 880,
"height": 1664,
"content": "# 🛍️ Automated Product Description Generation for Adobe Commerce (Magento 2)\n\n## Description\nThis n8n template demonstrates how to automatically generate **product descriptions** for items in **Adobe Commerce (Magento 2)** that are missing one. \n\nThe workflow retrieves product data, converts raw attribute values (like numeric IDs) into **human-readable labels**, and passes the enriched product data to an **LLM** (Azure OpenAI by default). The LLM generates a compelling description, which is then saved back to Magento using the API. \n\nThis ensures all products have professional descriptions without manual writing effort.\n\n**Use cases include:** \n- Auto-generating missing descriptions for catalog completeness. \n- Creating consistent descriptions across large product datasets. \n- Reducing manual workload for content managers. \n- Tailoring descriptions for SEO and customer readability. \n\n---\n\n## Good to know\n- All **attribute options** are resolved to human-readable labels before being sent to the LLM. \n- The flow uses **Azure OpenAI**, but you can replace it with **OpenAI, Anthropic, Gemini, or other LLM providers**. \n- The LLM prompt can be **customised** to adjust tone, length, SEO-focus, or specific brand style. \n- Works out-of-the-box with Adobe Commerce (Magento 2) APIs, but can be adapted for other ecommerce systems. \n\n---\n\n## How it works\n1. **Get Product from Magento** \n - Retrieves a product that has no description. \n - Collects all product attributes.\n\n2. **Generate Description with LLM** \n - Resolves attribute option IDs into **human-readable values** (e.g. `color_id = 23 → \"Red\"`). \n - Passes the readable product attributes to an **Azure OpenAI model**. \n - The LLM creates a clear, engaging product description. \n - The prompt can be customised (e.g. SEO-optimized, short catalog text, or marketing style). \n\n3. **Save Description in Magento** \n - Updates the product via the **Magento API** with the generated description. \n - Ensures product data is enriched and visible in the webshop immediately. \n\n---\n\n## How to use\n- Configure your **Magento 2 API credentials** in n8n. \n- Replace the **Azure OpenAI** node with another provider if needed. \n- Adjust the **prompt** to match your brand’s tone of voice. \n- Run the workflow to automatically process products missing descriptions. \n\n---\n\n## Requirements\n- ✅ n8n instance (self-hosted or cloud) \n- ✅ Adobe Commerce (Magento 2) instance with API access \n- ✅ Azure OpenAI (or other LLM provider) credentials \n- (Optional) Prompt customisations for SEO or brand voice \n\n---\n\n## Customising this workflow\nThis workflow can be adapted for: \n- **Other attributes**: Include or exclude attributes (e.g. only color & size for apparel). \n- **Different LLMs**: Swap Azure OpenAI for OpenAI, Anthropic, Gemini, or any supported n8n AI node. \n- **Prompt tuning**: Adjust instructions to generate shorter, longer, or SEO-rich descriptions. \n- **Selective updates**: Target only specific categories (e.g. electronics, fashion). \n- **Multi-language support**: Generate product descriptions in multiple languages for international shops. \n\n---\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "11259216-9fa3-4fea-b872-e36c88d412c8",
"connections": {
"e127791d-b564-4c23-86a2-a55cbe1bad49": {
"main": [
[
{
"node": "5373fa9b-e857-435f-a3ae-08978e7717df",
"type": "main",
"index": 0
}
]
]
},
"5373fa9b-e857-435f-a3ae-08978e7717df": {
"main": [
[
{
"node": "1e10c1ee-3777-466e-ab0f-a211046f4114",
"type": "main",
"index": 0
}
]
]
},
"1e10c1ee-3777-466e-ab0f-a211046f4114": {
"main": [
[],
[]
]
},
"9c551919-8e15-44bb-937b-3ae06dc5ffc2": {
"main": [
[
{
"node": "e127791d-b564-4c23-86a2-a55cbe1bad49",
"type": "main",
"index": 0
}
]
]
},
"5198d2bb-89db-401a-bf35-21884378c2f5": {
"main": [
[
{
"node": "9c551919-8e15-44bb-937b-3ae06dc5ffc2",
"type": "main",
"index": 0
}
]
]
},
"487315aa-572d-40a4-ba61-a091b8157061": {
"ai_languageModel": [
[
{
"node": "e127791d-b564-4c23-86a2-a55cbe1bad49",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"88d7173a-e816-4530-87e5-6be43f44b5b2": {
"main": [
[
{
"node": "5198d2bb-89db-401a-bf35-21884378c2f5",
"type": "main",
"index": 1
}
]
]
},
"3807a3cf-d7aa-4315-8d25-cc6386b1181a": {
"main": [
[
{
"node": "5198d2bb-89db-401a-bf35-21884378c2f5",
"type": "main",
"index": 0
}
]
]
},
"7272f57f-3ebd-4a5d-a3ae-1c6a16e0a140": {
"main": [
[
{
"node": "88d7173a-e816-4530-87e5-6be43f44b5b2",
"type": "main",
"index": 0
},
{
"node": "3807a3cf-d7aa-4315-8d25-cc6386b1181a",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 杂项, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用AI将PDF采购订单自动化转换为Adobe Commerce销售订单
使用AI将PDF采购订单自动化转换为Adobe Commerce销售订单
If
Set
Code
+
If
Set
Code
96 节点JKingma
文档提取
使用Veo 3、Gemini和Creatomate生成并发布专业视频广告
使用Veo 3、Gemini和Creatomate生成并发布专业视频广告
Jwt
Set
Code
+
Jwt
Set
Code
66 节点LukaszB
内容创作
使用Google Nano Banana和Kie.ai放大创建一致的AI角色
使用Google Nano Banana和Kie.ai放大创建一致的AI角色
Set
Code
Wait
+
Set
Code
Wait
33 节点Muhammad Farooq Iqbal
杂项
每日 WhatsApp 群组智能分析:GPT-4.1 分析与语音消息转录
每日 WhatsApp 群组智能分析:GPT-4.1 分析与语音消息转录
If
Set
Code
+
If
Set
Code
52 节点Daniel Lianes
杂项
使用AI分析检测病毒式YouTube视频并发送邮件报告
使用AI分析检测病毒式YouTube视频并发送邮件报告
Set
Code
Sort
+
Set
Code
Sort
26 节点gclbck
杂项
实时 - 使用Gemini和Creatomate自动化病毒式AI视频制作与发布
使用Gemini和Creatomate自动化AI视频创作与多平台发布
Set
Code
Wait
+
Set
Code
Wait
47 节点Intuz
内容创作