已验证产品退货指南生成器
高级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 23 个节点。主要使用 Set, Code, Gmail, Merge, Switch 等节点。 使用邮件验证、PDF/图片生成和二维码自动化电商退货指南
前置要求
- •Google 账号和 Gmail API 凭证
- •HTTP Webhook 端点(n8n 会自动生成)
使用的节点 (23)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"name": "已验证产品退货指南生成器",
"tags": [
"CustomerService",
"EcommerceAutomation",
"FraudPrevention",
"PDF",
"EmailAutomation",
"Returns",
"QRCode"
],
"nodes": [
{
"id": "464b2f78-5628-4e89-bc6c-9f7042ee365c",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
0,
0
],
"parameters": {
"path": "/return-guide",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "ce00c4ea-2c67-4bbc-95a8-16fc5b7a1619",
"name": "Verifi邮箱验证",
"type": "n8n-nodes-verifiemail.verifiEmail",
"position": [
176,
-224
],
"parameters": {
"email": "={{ $json.body.customer_email }}"
},
"credentials": {
"verifiEmailApi": {
"id": "VERIFI_EMAIL_CREDENTIAL_ID",
"name": "VerifiEmail API"
}
},
"typeVersion": 1
},
{
"id": "3fe3e398-a883-418e-b492-2e3c6b2a0f3b",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
352,
-144
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "79d1536b-afac-47cd-9275-c4b9ddd8e8f0",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.valid }}",
"rightValue": true
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7ef0a1ec-a909-4047-8c98-1a93b2e83b73",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.valid }}",
"rightValue": false
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "0228f0be-9e93-4183-be31-f2bf0ade679e",
"name": "停止与错误",
"type": "n8n-nodes-base.stopAndError",
"position": [
544,
-336
],
"parameters": {
"errorMessage": "Email validation failed"
},
"typeVersion": 1
},
{
"id": "1291babb-4454-467c-b7f9-ccbc4a40a66d",
"name": "编辑字段",
"type": "n8n-nodes-base.set",
"position": [
736,
112
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "4f3c06c9-058b-4208-bec4-bd0287bc2504",
"name": "instructions",
"type": "string",
"value": "={{ \"1. Carefully pack the item in its original packaging\\n2. Attach the return label to the outside of package\\n3. Drop off at any post office or schedule pickup\\n4. Track your return using the provided tracking number\" }}"
},
{
"id": "ce98acec-f236-4bb0-9f2e-8b3d32d1b4ba",
"name": "qr_url",
"type": "string",
"value": "={{ \"https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=\" + $('Webhook').item.json.body.order_id }}"
},
{
"id": "0b0b9251-a2aa-4328-b42d-b48fd3d72e3d",
"name": "return_deadline",
"type": "string",
"value": "={{ $now.plus(7, 'days').toFormat('yyyy-MM-dd') }}"
},
{
"id": "eeae6616-0977-4895-9a96-8795abff8cc1",
"name": "tracking_url",
"type": "string",
"value": "={{ \"https://track.example.com/\" + $('Webhook').item.json.body.order_id }}"
},
{
"id": "44ecca02-201f-4b98-a9ae-2dc509e619bb",
"name": "customer_name",
"type": "string",
"value": "={{$input.all()[1].json.body.customer_name}}"
},
{
"id": "921c0f42-b7e4-4e9b-abdd-990e682f0a49",
"name": "customer_email",
"type": "string",
"value": "={{$input.all()[1].json.body.customer_email}}"
},
{
"id": "c4b1bd0b-4f8e-46e9-a72e-c4f9a0ab93e8",
"name": " order_id",
"type": "string",
"value": "={{$input.all()[1].json.body.order_id}}"
},
{
"id": "1a074f7a-0bde-4ef8-86c0-97e4c9372d71",
"name": "return_reason",
"type": "string",
"value": "={{$input.all()[1].json.body.return_reason}}"
},
{
"id": "33cf2a33-535e-4154-a8f9-9beae030d02b",
"name": " product_name",
"type": "string",
"value": "={{$input.all()[1].json.body.product_name}}"
},
{
"id": "a2f9508d-64be-48d7-9632-ad6407bc81cf",
"name": " purchase_date",
"type": "string",
"value": "={{$input.all()[1].json.body.purchase_date}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5e2840f5-e714-49e2-bb7b-220461b0d286",
"name": "JavaScript代码",
"type": "n8n-nodes-base.code",
"position": [
1232,
-16
],
"parameters": {
"jsCode": "// Get data from Remove Duplicates node (clean single item)\nconst data = $input.all()[0].json;\n\n// Note: Some fields have a space at the beginning, so we need to handle that\nconst cleanData = {\n instructions: data.instructions,\n qr_url: data.qr_url,\n return_deadline: data.return_deadline,\n tracking_url: data.tracking_url,\n customer_name: data.customer_name,\n customer_email: data.customer_email,\n order_id: data[' order_id'] || data.order_id, // Handle space in field name\n return_reason: data.return_reason,\n product_name: data[' product_name'] || data.product_name, // Handle space in field name\n purchase_date: data[' purchase_date'] || data.purchase_date // Handle space in field name\n};\n\n// Generate HTML content\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Return Guide - Order ${cleanData.order_id}</title>\n <style>\n body {\n font-family: 'Arial', sans-serif;\n line-height: 1.6;\n color: #333;\n max-width: 800px;\n margin: 0 auto;\n padding: 20px;\n background-color: #f9f9f9;\n }\n .guide {\n background: white;\n border-radius: 10px;\n padding: 30px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n }\n .header {\n text-align: center;\n border-bottom: 2px solid #007bff;\n padding-bottom: 20px;\n margin-bottom: 30px;\n }\n .header h1 {\n color: #007bff;\n margin: 0 0 10px 0;\n }\n .qr {\n text-align: center;\n margin: 20px 0;\n padding: 20px;\n background: #f8f9fa;\n border-radius: 8px;\n border: 2px dashed #007bff;\n }\n .qr img {\n border: 2px solid #007bff;\n border-radius: 8px;\n padding: 10px;\n background: white;\n }\n .item-img {\n max-width: 200px;\n height: auto;\n border-radius: 8px;\n margin: 10px 0;\n border: 1px solid #dee2e6;\n }\n .instructions {\n background: #e9ecef;\n padding: 20px;\n border-radius: 8px;\n margin: 20px 0;\n border-left: 4px solid #007bff;\n }\n .instructions h3 {\n color: #007bff;\n margin-top: 0;\n }\n .instructions ol {\n margin: 0;\n padding-left: 20px;\n }\n .instructions li {\n margin: 10px 0;\n font-weight: 500;\n }\n .details-table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n background: white;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n }\n .details-table td {\n padding: 15px;\n border-bottom: 1px solid #dee2e6;\n }\n .details-table tr:last-child td {\n border-bottom: none;\n }\n .details-table td:first-child {\n font-weight: bold;\n width: 35%;\n background: #f8f9fa;\n color: #007bff;\n }\n .footer {\n text-align: center;\n margin-top: 30px;\n padding-top: 20px;\n border-top: 1px solid #dee2e6;\n color: #6c757d;\n font-size: 14px;\n }\n .status-badge {\n display: inline-block;\n background: #28a745;\n color: white;\n padding: 5px 10px;\n border-radius: 15px;\n font-size: 12px;\n font-weight: bold;\n margin-bottom: 10px;\n }\n .deadline-warning {\n background: #fff3cd;\n border: 1px solid #ffeaa7;\n color: #856404;\n padding: 15px;\n border-radius: 8px;\n margin: 20px 0;\n }\n .contact-box {\n background: #e3f2fd;\n border-left: 4px solid #2196f3;\n padding: 15px;\n margin: 20px 0;\n border-radius: 0 8px 8px 0;\n }\n </style>\n</head>\n<body>\n <div class=\"guide\">\n <div class=\"header\">\n <div class=\"status-badge\">RETURN APPROVED</div>\n <h1>Return Authorization Guide</h1>\n <p><strong>Order ID:</strong> ${cleanData.order_id}</p>\n <p><strong>Customer:</strong> ${cleanData.customer_name}</p>\n </div>\n \n <div class=\"deadline-warning\">\n <strong>⚠️ Important:</strong> Return must be shipped by <strong>${cleanData.return_deadline}</strong> to be eligible for refund.\n </div>\n \n <div class=\"qr\">\n <h3>🏷️ Scan for Quick Processing</h3>\n <img src=\"${cleanData.qr_url}\" alt=\"QR Code for Order ${cleanData.order_id}\">\n <p><strong>Present this QR code at any drop-off location</strong></p>\n <p style=\"font-size: 12px; color: #666;\">This QR code contains your order information for faster processing</p>\n </div>\n \n <div class=\"instructions\">\n <h3>📦 Step-by-Step Return Instructions</h3>\n <ol>\n <li>Carefully pack the item in its original packaging</li>\n <li>Attach the return label to the outside of package</li>\n <li>Drop off at any post office or schedule pickup</li>\n <li>Track your return using the provided tracking number</li>\n </ol>\n </div>\n \n <table class=\"details-table\">\n <tr>\n <td>Customer Name</td>\n <td>${cleanData.customer_name}</td>\n </tr>\n <tr>\n <td>Email Address</td>\n <td>${cleanData.customer_email}</td>\n </tr>\n <tr>\n <td>Product</td>\n <td>${cleanData.product_name}</td>\n </tr>\n <tr>\n <td>Return Reason</td>\n <td>${cleanData.return_reason}</td>\n </tr>\n <tr>\n <td>Original Purchase Date</td>\n <td>${cleanData.purchase_date}</td>\n </tr>\n <tr>\n <td>Return Deadline</td>\n <td><strong>${cleanData.return_deadline}</strong></td>\n </tr>\n </table>\n \n <div style=\"text-align: center; margin: 30px 0;\">\n <img class=\"item-img\" src=\"https://via.placeholder.com/200x150/007bff/ffffff?text=${encodeURIComponent(cleanData.product_name || 'Product')}\" alt=\"Product Image\">\n <p style=\"font-size: 12px; color: #666;\">Product representation (actual item may vary)</p>\n </div>\n \n <div class=\"contact-box\">\n <h4 style=\"margin: 0 0 10px 0;\">📞 Need Help?</h4>\n <p style=\"margin: 0;\">Contact our support team at <strong>support@yourstore.com</strong> or call <strong>1-800-RETURNS</strong></p>\n </div>\n \n <div class=\"footer\">\n <p><strong>📦 Track Your Return:</strong></p>\n <p><a href=\"${cleanData.tracking_url}\" style=\"color: #007bff; text-decoration: none;\">${cleanData.tracking_url}</a></p>\n <hr style=\"margin: 20px 0; border: none; border-top: 1px solid #dee2e6;\">\n <p>Return Guide Generated on ${new Date().toLocaleDateString()} at ${new Date().toLocaleTimeString()}</p>\n <p style=\"font-size: 12px;\">This is an automated return authorization. Please keep this document for your records.</p>\n </div>\n </div>\n</body>\n</html>\n`;\n\n// Return the result\nreturn [{\n json: {\n html_content: html,\n customer_name: cleanData.customer_name,\n customer_email: cleanData.customer_email,\n order_id: cleanData.order_id,\n file_name: `return_guide_${cleanData.order_id}`\n }\n}];"
},
"typeVersion": 2
},
{
"id": "21b85c24-5bd7-47dd-b0d3-ee3ab96c3224",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
544,
112
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "baa731ae-cf48-41f8-869b-cc6b5c1971b9",
"name": "移除重复项",
"type": "n8n-nodes-base.removeDuplicates",
"position": [
928,
112
],
"parameters": {
"options": {}
},
"typeVersion": 2
},
{
"id": "e438ee05-1d2b-4f3b-8834-120d743f7c84",
"name": "HTML 转 PDF",
"type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
"position": [
1712,
-176
],
"parameters": {
"html_content": "={{ $json.html_content }}"
},
"credentials": {
"htmlcsstopdfApi": {
"id": "HTML_CSS_TO_PDF_CREDENTIAL_ID",
"name": "HtmlCssToPdf API"
}
},
"typeVersion": 1
},
{
"id": "c360666e-5bad-4fc1-969e-e9da7ccc135a",
"name": "HTML/CSS 转图像",
"type": "n8n-nodes-htmlcsstoimage.htmlCssToImage",
"position": [
1712,
128
],
"parameters": {
"html_content": "={{ $json.html_content }}"
},
"credentials": {
"htmlcsstoimgApi": {
"id": "HTML_CSS_TO_IMAGE_CREDENTIAL_ID",
"name": "HtmlCssToImage API"
}
},
"typeVersion": 1
},
{
"id": "8d26ce37-8064-4396-aa91-39aaaffe5c2d",
"name": "遍历项目",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1456,
-16
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "3d5970f2-981f-4cd9-8dd0-691a9b9a91c9",
"name": "合并1",
"type": "n8n-nodes-base.merge",
"position": [
2112,
0
],
"parameters": {
"mode": "combine",
"options": {},
"fieldsToMatchString": "success"
},
"typeVersion": 3.2
},
{
"id": "58f8f743-e22b-4c41-a47a-d29dddfee4f0",
"name": "发送消息",
"type": "n8n-nodes-base.gmail",
"position": [
2448,
0
],
"parameters": {
"sendTo": "{{ $('Loop Over Items').item.json.customer_email }}",
"message": "=Dear {{ $('Code in JavaScript').item.json.customer_name }},\n\nYour return request for order {{ $('Code in JavaScript').item.json.order_id }} has been approved.\n\nDOWNLOAD YOUR RETURN GUIDE:\nPDF Guide:{{ $json.pdf_url }} \nPNG Preview: {{ $json.image_url }}\n\nNEXT STEPS:\n1. Download and print the PDF return guide\n2. Follow the packaging instructions carefully\n3. Use the QR code for faster processing at drop-off\n4. Ship by {{ $('Remove Duplicates').item.json.return_deadline }}\n\nIMPORTANT: Return must be shipped by the deadline to be eligible for refund.\n\nQuestions? Reply to this email or contact our support team.\n\nBest regards,\nCustomer Service Team\n\n---\nThis return authorization was generated automatically on {{ $now.toFormat('yyyy-MM-dd') }}.\nPlease keep this email for your records.",
"options": {},
"subject": "=Return Guide for Order {{ $('Loop Over Items').item.json.order_id }} - Action Required",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "GMAIL_OAUTH2_CREDENTIAL_ID",
"name": "Gmail OAuth2"
}
},
"typeVersion": 2.1
},
{
"id": "0b1dfe14-47de-43c7-aff9-0a61ec2213ad",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-272,
-16
],
"parameters": {
"color": 7,
"width": 384,
"height": 432,
"content": "## WEBHOOK 触发器"
},
"typeVersion": 1
},
{
"id": "ef6eb130-73ed-4ccd-8d5d-a96f75d003ac",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-304
],
"parameters": {
"color": 7,
"width": 368,
"height": 224,
"content": "## 邮箱验证"
},
"typeVersion": 1
},
{
"id": "cec3e76f-7a41-4f53-a134-7e43848655e2",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
496,
96
],
"parameters": {
"color": 7,
"width": 576,
"height": 416,
"content": "## 数据准备"
},
"typeVersion": 1
},
{
"id": "96bc0a8c-2680-4839-90bd-5641b294afe1",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1152,
-368
],
"parameters": {
"color": 7,
"width": 272,
"height": 480,
"content": "## HTML 模板生成器"
},
"typeVersion": 1
},
{
"id": "0b5e9a8e-3009-45d5-8642-dba4b1a33101",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1648,
-416
],
"parameters": {
"color": 7,
"width": 320,
"height": 704,
"content": "## 并行转换"
},
"typeVersion": 1
},
{
"id": "7800fed4-5072-4810-bd75-71e2851b02cb",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2368,
-352
],
"parameters": {
"color": 7,
"width": 304,
"height": 496,
"content": "## 自动邮件发送"
},
"typeVersion": 1
},
{
"id": "bd681c09-d39d-4fa2-91fd-5b063baebefc",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-736,
-304
],
"parameters": {
"color": 7,
"width": 480,
"height": 224,
"content": "## 已验证退货指南生成器"
},
"typeVersion": 1
},
{
"id": "0ca8bdde-6679-4cc7-983a-873b75a7fac0",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
-608
],
"parameters": {
"color": 7,
"width": 304,
"height": 400,
"content": "## 欺诈预防"
},
"typeVersion": 1
},
{
"id": "ca0aed99-24a7-4197-820b-7308cc3c7e17",
"name": "便签8",
"type": "n8n-nodes-base.stickyNote",
"position": [
2368,
304
],
"parameters": {
"color": 7,
"width": 336,
"height": 336,
"content": "## 自定义选项"
},
"typeVersion": 1
},
{
"id": "setup-credentials-note",
"name": "凭证设置",
"type": "n8n-nodes-base.stickyNote",
"position": [
-736,
304
],
"parameters": {
"color": 5,
"width": 368,
"height": 480,
"content": "## 所需凭证设置"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2bb970b1-01be-4c88-8c69-4743729e6820",
"connections": {
"Merge": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Verifi Email",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Remove Duplicates",
"type": "main",
"index": 0
}
]
]
},
"HTML to PDF": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Verifi Email": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "HTML/CSS to Image",
"type": "main",
"index": 0
},
{
"node": "HTML to PDF",
"type": "main",
"index": 0
}
]
]
},
"HTML/CSS to Image": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Remove Duplicates": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
自动化网红营销活动管理系统
使用Instagram/YouTube API自动化网红评估与活动管理
If
Code
Gmail
+8
24 节点Jitesh Dugar
内容创作
会议纪要和行动项跟踪器
基于AI的会议纪要:使用GPT-4、任务分配和多渠道分发
If
Set
Code
+10
38 节点Jitesh Dugar
内容创作
防欺诈潜在客户捕获与培育系统
通过AI评分、表格跟踪和多渠道提醒捕获和培育防欺诈潜在客户
If
Set
Code
+11
28 节点Jitesh Dugar
内容创作
证书生成器
使用VerifiEmail和HTMLcsstoImg生成证书并通过Gmail发送
If
Code
Gmail
+8
25 节点Jitesh Dugar
内容创作
客户入职邮件验证
使用VerifiEmail、Gmail和Slack的自动化邮件验证与入职流程
If
Code
Gmail
+6
21 节点Jitesh Dugar
内容创作
客户入职工作流
使用PDF、Trello、Slack、Gmail和Airtable简化客户入职流程
If
Code
Gmail
+10
22 节点Jitesh Dugar
内容创作
工作流信息
难度等级
高级
节点数量23
分类2
节点类型13
作者
Jitesh Dugar
@jiteshdugarAI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.
外部链接
在 n8n.io 查看 →
分享此工作流