带语气选择的AI邮件生成器
中级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Set, Code, Form, FormTrigger, Agent 等节点。 使用OpenAI GPT生成带自定义语气的专业邮件
前置要求
- •OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "zQkM15rEmD23HAeW",
"meta": {
"instanceId": "8e5c0196cd9c25c3b614ccc37109266dd4ae7fef2aa858eab9011bdc62218bf1",
"templateCredsSetupCompleted": true
},
"name": "带语气选择的AI邮件生成器",
"tags": [
{
"id": "sBLDO4c3ubWvhiSj",
"name": "n8n creator",
"createdAt": "2025-09-30T20:55:34.201Z",
"updatedAt": "2025-09-30T20:55:34.201Z"
}
],
"nodes": [
{
"id": "a7d25cbb-f1f1-451c-bb89-7dcfaa5f8915",
"name": "邮件生成器表单",
"type": "n8n-nodes-base.formTrigger",
"position": [
416,
288
],
"webhookId": "email-gen-form",
"parameters": {
"options": {},
"formTitle": "AI Email Generator",
"formFields": {
"values": [
{
"fieldLabel": "Recipient Name",
"requiredField": true
},
{
"fieldLabel": "Email Subject",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "Email Context",
"requiredField": true
},
{
"fieldType": "dropdown",
"fieldLabel": "Tone",
"fieldOptions": {
"values": [
{
"option": "Professional"
},
{
"option": "Friendly"
},
{
"option": "Formal"
},
{
"option": "Casual"
}
]
},
"requiredField": true
}
]
},
"formDescription": "Generate professional emails with your chosen tone"
},
"typeVersion": 2.2
},
{
"id": "336e7273-30ca-4800-a8b2-01eaadaa0e32",
"name": "提取表单数据",
"type": "n8n-nodes-base.set",
"position": [
640,
288
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "recipient-field",
"name": "recipient",
"type": "string",
"value": "={{ $json['Recipient Name'] }}"
},
{
"id": "subject-field",
"name": "subject",
"type": "string",
"value": "={{ $json['Email Subject'] }}"
},
{
"id": "context-field",
"name": "context",
"type": "string",
"value": "={{ $json['Email Context'] }}"
},
{
"id": "tone-field",
"name": "tone",
"type": "string",
"value": "={{ $json['Tone'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "fd094524-76b1-45cd-ac72-402aefc39ff9",
"name": "构建AI提示",
"type": "n8n-nodes-base.code",
"position": [
864,
288
],
"parameters": {
"jsCode": "const recipient = $input.item.json.recipient;\nconst subject = $input.item.json.subject;\nconst context = $input.item.json.context;\nconst tone = $input.item.json.tone.toLowerCase();\n\nlet toneInstructions = '';\n\nswitch(tone) {\n case 'professional':\n toneInstructions = 'Use a professional, business-appropriate tone. Be clear, concise, and respectful. Maintain a balance between friendliness and formality.';\n break;\n case 'friendly':\n toneInstructions = 'Use a warm, friendly tone while remaining appropriate. Be conversational and approachable, but maintain professionalism.';\n break;\n case 'formal':\n toneInstructions = 'Use a highly formal, diplomatic tone. Use proper salutations and maintain strict formality throughout. Be respectful and courteous.';\n break;\n case 'casual':\n toneInstructions = 'Use a casual, relaxed tone. Be conversational and natural, as if writing to a colleague or friend.';\n break;\n default:\n toneInstructions = `Use a ${tone} tone.`;\n}\n\nconst prompt = `Write a complete email with the following details:\n\nRecipient: ${recipient}\nSubject: ${subject}\nContext: ${context}\n\nTone Instructions: ${toneInstructions}\n\nFormat the email properly with:\n- An appropriate greeting\n- A clear body that addresses the context\n- A professional closing\n- Do not include a signature line (the user will add their own)\n\nWrite only the email content, nothing else.`;\n\nreturn {\n json: {\n prompt: prompt,\n recipient: recipient,\n subject: subject,\n tone: tone\n }\n};"
},
"typeVersion": 2
},
{
"id": "a34dcc52-0851-406d-8197-e47458bba309",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1072,
496
],
"parameters": {
"model": "gpt-3.5-turbo",
"options": {
"maxTokens": 500,
"temperature": 0.7
}
},
"credentials": {
"openAiApi": {
"id": "N0CW82ghPMjVVpjB",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "cffb3447-a441-4c94-9eb4-bdada01d4124",
"name": "生成邮件",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1104,
288
],
"parameters": {
"text": "={{ $json.prompt }}",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "e35fba09-e164-4333-9caa-5928f0f028dc",
"name": "格式化输出",
"type": "n8n-nodes-base.set",
"position": [
1408,
288
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "email-body",
"name": "email_body",
"type": "string",
"value": "={{ $json.output }}"
},
{
"id": "email-subject",
"name": "subject",
"type": "string",
"value": "={{ $('Extract Form Data').item.json.subject }}"
},
{
"id": "email-tone",
"name": "tone",
"type": "string",
"value": "={{ $('Extract Form Data').item.json.tone }}"
},
{
"id": "email-recipient",
"name": "recipient",
"type": "string",
"value": "={{ $('Extract Form Data').item.json.recipient }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "7b0de931-82fa-46f6-aaa2-565c41bfceb5",
"name": "显示生成的邮件",
"type": "n8n-nodes-base.form",
"position": [
1632,
288
],
"webhookId": "email-completion",
"parameters": {
"options": {},
"operation": "completion",
"completionTitle": "✅ Email Generated Successfully!",
"completionMessage": "=**Subject:** {{ $json.subject }}\n\n**Tone:** {{ $json.tone }}\n\n**Recipient:** {{ $json.recipient }}\n\n---\n\n{{ $json.email_body }}\n\n---\n\n*Copy the email above and add your signature before sending.*"
},
"typeVersion": 1
},
{
"id": "c5bc8234-00b1-4af0-a2e4-f6b9a547aaf0",
"name": "主要描述",
"type": "n8n-nodes-base.stickyNote",
"position": [
-592,
-128
],
"parameters": {
"color": 5,
"width": 844,
"height": 1033,
"content": ""
},
"typeVersion": 1
},
{
"id": "daec94b3-1af5-4305-baca-75a2b05bdc34",
"name": "设置说明",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
512
],
"parameters": {
"color": 4,
"width": 396,
"height": 457,
"content": "### 🔧 设置步骤"
},
"typeVersion": 1
},
{
"id": "fc3da369-ac70-420d-bcf4-aca4c1eb9b6d",
"name": "步骤1",
"type": "n8n-nodes-base.stickyNote",
"position": [
384,
176
],
"parameters": {
"color": 7,
"width": 218,
"height": 98,
"content": "**步骤1:** 用户输入"
},
"typeVersion": 1
},
{
"id": "fa8e49fc-63bc-4df2-8d11-0124509d233a",
"name": "步骤2",
"type": "n8n-nodes-base.stickyNote",
"position": [
608,
176
],
"parameters": {
"color": 7,
"width": 218,
"height": 98,
"content": "**步骤2:** 提取和组织"
},
"typeVersion": 1
},
{
"id": "7574b96c-cff4-42c9-a128-bf82a9b971d0",
"name": "步骤3",
"type": "n8n-nodes-base.stickyNote",
"position": [
816,
176
],
"parameters": {
"color": 7,
"width": 218,
"height": 98,
"content": "**步骤3:** 构建提示"
},
"typeVersion": 1
},
{
"id": "2c9c5651-cb91-447a-9b27-5d2cf72142d0",
"name": "步骤4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1056,
176
],
"parameters": {
"color": 7,
"width": 218,
"height": 98,
"content": "**步骤4:** AI生成"
},
"typeVersion": 1
},
{
"id": "1c68f2f6-f826-4798-9ffe-64653475122f",
"name": "步骤5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
176
],
"parameters": {
"color": 7,
"width": 258,
"height": 98,
"content": "**步骤5:** 格式化和显示"
},
"typeVersion": 1
},
{
"id": "8992c076-cc45-48f4-af4c-494622cb72cc",
"name": "API密钥说明",
"type": "n8n-nodes-base.stickyNote",
"position": [
1136,
624
],
"parameters": {
"color": 3,
"height": 80,
"content": "⚙️ **在此配置您的API密钥**"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a7bf2666-fe9a-4709-87d6-e6f8874f169f",
"connections": {
"Format Output": {
"main": [
[
{
"node": "Display Generated Email",
"type": "main",
"index": 0
}
]
]
},
"Generate Email": {
"main": [
[
{
"node": "Format Output",
"type": "main",
"index": 0
}
]
]
},
"Build AI Prompt": {
"main": [
[
{
"node": "Generate Email",
"type": "main",
"index": 0
}
]
]
},
"Extract Form Data": {
"main": [
[
{
"node": "Build AI Prompt",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate Email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Email Generator Form": {
"main": [
[
{
"node": "Extract Form Data",
"type": "main",
"index": 0
}
]
]
},
"Display Generated Email": {
"main": [
[]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用AI将产品照片转换为营销图片
使用 Google Gemini AI 将产品图片转换为营销广告
Set
Code
Form
+5
12 节点Biznova
内容创作
AI DJ:基于Linkup和GPT4的文本转Spotify歌单生成器
AI DJ:基于Linkup和GPT4的文本转Spotify歌单生成器
Set
Form
Spotify
+7
17 节点Guillaume Duvernay
内容创作
使用Airtop、GPT-4 Mini和Gmail分析网站UX和SEO质量
使用Airtop、GPT-4 Mini和Gmail分析网站UX和SEO质量
Set
Code
Html
+10
33 节点LukaszB
内容创作
WordPress博客自动化专业版(深度研究)v2.1市场
使用GPT-4o、Perplexity AI和多语言支持自动化SEO优化的博客创建
If
Set
Xml
+27
125 节点Daniel Ng
内容创作
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
Set
Code
Wait
+16
97 节点Adam Crafts
内容创作
使用OpenAI和Firecrawl从产品URL创建AI生成的Meta广告活动
使用OpenAI和Firecrawl从产品URL创建AI生成的Meta广告活动
If
Set
Code
+15
40 节点Adam Crafts
内容创作
工作流信息
难度等级
中级
节点数量15
分类2
节点类型7
作者
Biznova
@biznovaAutomating your biz, one workflow at a time. I build and share powerful n8n workflows to save you hours and boost productivity. All workflows are completely free. Streamline your operations with no-code.
外部链接
在 n8n.io 查看 →
分享此工作流