通过Excel + AI的智能邮件营销生成器(表格到收件箱)
这是一个Social Media, Multimodal AI领域的自动化工作流,包含 7 个节点。主要使用 Code, Gmail, GoogleSheets, Agent, GoogleSheetsTrigger 等节点。 基于Google Sheets使用Llama AI生成个性化营销邮件
- •Google 账号和 Gmail API 凭证
- •Google Sheets API 凭证
{
"id": "78yYRensL5z0adQK",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "通过 Excel + AI 的智能邮件营销生成器(表格到收件箱)",
"tags": [],
"nodes": [
{
"id": "e7f44537-37ee-4ce8-8d9a-25e1e512bcbe",
"name": "使用 AI 生成营销内容",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-220,
80
],
"parameters": {
"text": "=You are an expert sales copywriter. Based on the provided offer data, generate a persuasive and emotionally engaging promotional message for WhatsApp or Email that motivates immediate customer action.\n\n🎯 **Objective:**\nEncourage purchases by emphasizing value, benefits, urgency, and exclusivity with a detailed, impactful message.\n\n📌 **Format Guidelines:**\n- Keep under 150 words.\n- Use short, readable lines for WhatsApp/email.\n- Include 3–5 well-placed emojis for visual appeal.\n- Write in a warm, enthusiastic, benefit-driven tone.\n- Use bold hooks, clear product benefits, urgency, and rewards.\n- Structure with multiple unordered lists (`<ul>`) for impact and readability.\n\n📋 **Offer Data:**\n- Title: {{ $json.title }}\n- Discount: {{ $json.discount }}\n- Validity: {{ $json.validity }}\n- Products Included: {{ $json.products_included }}\n- Original Price: {{ $json.original_price }}\n- Discounted Price: {{ $json.discounted_price }}\n- Bonus Item: {{ $json.bonus }}\n- Call to Action: {{ $json.cta }}\n\n---\n\n📢 **Message Structure:**\n1. Start with a catchy, energetic title using 1–2 emojis and {{ $json.title }}.\n2. Hook with emotional language (e.g., “refresh your style,” “upgrade your look”).\n3. State {{ $json.discounted_price }} vs {{ $json.original_price }} and {{ $json.discount }} as a steal.\n4. List {{ $json.products_included }} in a `<ul>` with specific benefits (e.g., fabric, fit, usage).\n5. Highlight bundle value in a second `<ul>` (e.g., quality, versatility, savings).\n6. Present {{ $json.bonus }} as an exclusive gift with an emoji (e.g., 🎁).\n7. Emphasize urgency with {{ $json.validity }} and “limited stock” using ⏳.\n8. End with a motivational line and {{ $json.cta }} to create FOMO.\n\n---\n\n🧾 **Sample Output Format:**\n\n🔥 LAST CHANCE: {{ $json.title }}! 🌞\n\nReady to refresh your style? Grab this **limited-time deal** curated for you!\n\n💸 Only {{ $json.discounted_price }} ({{ $json.discount }} OFF {{ $json.original_price }}) — save big now!\n\n✨ **What’s Included:**\n<ul>\n <li>👕 Stylish Shirt – breathable cotton for all-day comfort</li>\n <li>👔 Classic T-Shirt – perfect for any summer vibe</li>\n</ul>\n\n🛍️ **Why You’ll Love It:**\n<ul>\n <li>✔️ Premium quality at a steal</li>\n <li>✔️ Versatile looks for any occasion</li>\n <li>✔️ Curated bundle, no guesswork</li>\n</ul>\n\n🎁 **Exclusive Bonus:** {{ $json.bonus }} – yours free!\n\n⏳ **Hurry!** Offer ends {{ $json.validity }}. Limited stock!\n\n👉 Don’t wait – {{ $json.cta }} now to slay the season in style!\n\n---\n\n✅ **Notes:**\n- Make the message personal, warm, and engaging.\n- Avoid robotic or templated language.\n- Use `<ul>` for product details and benefits to enhance readability.\n- Ensure clear formatting with emojis, short lines, and emotional appeal.\n- Do not include notes or explanations in the output.",
"options": {},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "ba71be80-b532-40d5-8bdf-c4bbf48c28e0",
"name": "格式化个性化邮件",
"type": "n8n-nodes-base.code",
"position": [
360,
80
],
"parameters": {
"jsCode": "const emails = items.map(item => item.json.Emial);\nreturn [\n {\n json: {\n allEmails: emails.join(\", \"),\n output : $('Generate Marketing Content with AI').first().json.output\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "bf3e161a-be8b-45b5-859d-b5404fe0264b",
"name": "向客户发送营销邮件",
"type": "n8n-nodes-base.gmail",
"position": [
580,
80
],
"webhookId": "012ca109-03f0-445c-826c-45b4e85d21fe",
"parameters": {
"sendTo": "={{ $json.allEmails }}",
"message": "={{ $json.output }}",
"options": {},
"subject": "Offer",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "PcTqvGU9uCunfltE",
"name": "Gmail account - test"
}
},
"typeVersion": 2.1
},
{
"id": "57b81093-4e88-497a-a70c-fb3f5923bd06",
"name": "Llama 3.2 - 促销内容模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"position": [
-140,
300
],
"parameters": {
"model": "llama3.2-16000:latest",
"options": {}
},
"credentials": {
"ollamaApi": {
"id": "vDhjHnEfhHheDgd6",
"name": "Ollama-vrushti"
}
},
"typeVersion": 1
},
{
"id": "f3e90e4d-d8af-4964-b7cd-bf017d2076fe",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-840,
-300
],
"parameters": {
"width": 480,
"height": 200,
"content": "该工作流使用两个 Google Sheets 的数据自动生成并发送个性化营销邮件:"
},
"typeVersion": 1
},
{
"id": "8ed442d2-c771-4619-8935-e64134b7582c",
"name": "跟踪优惠表格更新(表格1)",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-440,
80
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1574728929,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg/edit#gid=1574728929",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg/edit?usp=drivesdk",
"cachedResultName": "Customer_details"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"id": "BoDTTv5L67GVL3Fi",
"name": "Google Sheets - test"
}
},
"typeVersion": 1
},
{
"id": "eee33c6c-0513-47ae-b097-70ce2a610243",
"name": "获取客户列表(表格2)",
"type": "n8n-nodes-base.googleSheets",
"position": [
140,
80
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1kRRDSoJNzVQAUbunYzAk-KUBcMjhuUw0PydGjLbbEVg/edit?usp=drivesdk",
"cachedResultName": "Customer_details"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.6
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "b95c6aa6-6060-4f25-92d0-f1e6ff06bda9",
"connections": {
"Format Personalized Email": {
"main": [
[
{
"node": " Send Marketing Email to Client",
"type": "main",
"index": 0
}
]
]
},
"Fetch Client List (Sheet 2)": {
"main": [
[
{
"node": "Format Personalized Email",
"type": "main",
"index": 0
}
]
]
},
"Llama 3.2 - Promo Content Model": {
"ai_languageModel": [
[
{
"node": "Generate Marketing Content with AI",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Generate Marketing Content with AI": {
"main": [
[
{
"node": "Fetch Client List (Sheet 2)",
"type": "main",
"index": 0
}
]
]
},
"Track Offer Sheet Updates (Sheet 1)": {
"main": [
[
{
"node": "Generate Marketing Content with AI",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 社交媒体, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
分享此工作流