8
n8n 中文网amn8n.com

自动化营销绩效邮件报告

中级

这是一个Document Extraction, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 Merge, Summarize, GoogleSheets, ManualTrigger, MicrosoftOutlook 等节点。 使用 Google Sheets 和 Outlook 自动生成营销绩效邮件报告

前置要求
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "dd0fb46b-c0ce-4499-a000-8a16fe234969",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3088,
        1232
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "67ca251f-bd65-4707-b807-9353033e205c",
      "name": "获取 Google Sheets 数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2848,
        1264
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 365710158,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit#gid=365710158",
          "cachedResultName": "Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/19aUQYZq02qHsCelO4eeV4sx_MTJJupC5qe0gDLQBtRA/edit?usp=drivesdk",
          "cachedResultName": "Sample Marketing Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "363322ba-a8f0-4269-afa2-6cc13f7f36b3",
      "name": "统计唯一客户数",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -2144,
        688
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Customer ID",
              "aggregation": "countUnique"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "d8d0162f-305a-4359-bdd6-ebf917202265",
      "name": "统计唯一营销活动数",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -2144,
        864
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Campaign",
              "aggregation": "countUnique"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "de8c8386-8fd7-49ed-bf90-88980ceb90f2",
      "name": "总计点击量",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -2144,
        1072
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Clicks",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6618e8fb-8eb2-43b8-bd5f-b00b7306c8c5",
      "name": "总计转化量",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -2144,
        1232
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Conversions",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c9a81add-1ec5-4db5-8f55-076cdc1db97a",
      "name": "总计支出",
      "type": "n8n-nodes-base.summarize",
      "position": [
        -2128,
        1408
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Spend ($)",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "cf7b8d92-15fa-46fd-a63f-0d1b2792f282",
      "name": "发送邮件报告1",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        -1472,
        1328
      ],
      "webhookId": "6a18e4a8-04ce-49a9-a2ad-451b8daf2df8",
      "parameters": {
        "subject": "Daily Marketing Performance",
        "bodyContent": "=<!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>Marketing Campaign Performance Report</title>\n    <style>\n        body {\n            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n            line-height: 1.6;\n            color: #1a1a1a;\n            max-width: 650px;\n            margin: 0 auto;\n            padding: 30px 20px;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            min-height: 100vh;\n        }\n        .container {\n            background: rgba(255, 255, 255, 0.95);\n            backdrop-filter: blur(20px);\n            padding: 40px;\n            border-radius: 24px;\n            box-shadow: \n                0 20px 40px rgba(0, 0, 0, 0.1),\n                0 8px 32px rgba(0, 0, 0, 0.08),\n                inset 0 1px 0 rgba(255, 255, 255, 0.4);\n            border: 1px solid rgba(255, 255, 255, 0.2);\n            position: relative;\n            overflow: hidden;\n        }\n        .container::before {\n            content: '';\n            position: absolute;\n            top: 0;\n            left: 0;\n            right: 0;\n            height: 4px;\n            background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);\n            background-size: 400% 400%;\n            animation: gradient 8s ease infinite;\n        }\n        @keyframes gradient {\n            0% { background-position: 0% 50%; }\n            50% { background-position: 100% 50%; }\n            100% { background-position: 0% 50%; }\n        }\n        h1 {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            -webkit-background-clip: text;\n            -webkit-text-fill-color: transparent;\n            background-clip: text;\n            font-size: 32px;\n            font-weight: 800;\n            margin-bottom: 40px;\n            text-align: center;\n            letter-spacing: -0.02em;\n        }\n        h2 {\n            color: #2d3748;\n            margin-bottom: 30px;\n            font-size: 24px;\n            font-weight: 700;\n            text-align: center;\n            position: relative;\n        }\n        h2::after {\n            content: '';\n            position: absolute;\n            bottom: -8px;\n            left: 50%;\n            transform: translateX(-50%);\n            width: 60px;\n            height: 3px;\n            background: linear-gradient(90deg, #667eea, #764ba2);\n            border-radius: 2px;\n        }\n        .summary-grid {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n            gap: 24px;\n            margin-bottom: 40px;\n        }\n        .metric-card {\n            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);\n            padding: 28px 24px;\n            border-radius: 16px;\n            border: 1px solid rgba(226, 232, 240, 0.8);\n            box-shadow: \n                0 4px 16px rgba(0, 0, 0, 0.08),\n                0 1px 4px rgba(0, 0, 0, 0.04);\n            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n            position: relative;\n            overflow: hidden;\n        }\n        .metric-card::before {\n            content: '';\n            position: absolute;\n            top: 0;\n            left: 0;\n            right: 0;\n            height: 3px;\n            background: linear-gradient(90deg, #667eea, #764ba2);\n            opacity: 0;\n            transition: opacity 0.3s ease;\n        }\n        .metric-card:hover {\n            transform: translateY(-4px);\n            box-shadow: \n                0 12px 32px rgba(0, 0, 0, 0.12),\n                0 4px 16px rgba(0, 0, 0, 0.08);\n        }\n        .metric-card:hover::before {\n            opacity: 1;\n        }\n        .metric-label {\n            font-weight: 600;\n            color: #64748b;\n            font-size: 13px;\n            margin-bottom: 8px;\n            text-transform: uppercase;\n            letter-spacing: 0.5px;\n        }\n        .metric-value {\n            font-size: 28px;\n            font-weight: 800;\n            background: linear-gradient(135deg, #1e293b 0%, #475569 100%);\n            -webkit-background-clip: text;\n            -webkit-text-fill-color: transparent;\n            background-clip: text;\n            letter-spacing: -0.02em;\n        }\n        .footer {\n            margin-top: 50px;\n            padding-top: 30px;\n            border-top: 1px solid rgba(226, 232, 240, 0.6);\n            text-align: center;\n            color: #64748b;\n            font-size: 13px;\n            font-weight: 500;\n        }\n        .footer p {\n            margin: 6px 0;\n        }\n        .footer p:first-child {\n            font-weight: 600;\n            color: #475569;\n        }\n        @media (max-width: 600px) {\n            body {\n                padding: 20px 15px;\n            }\n            .container {\n                padding: 30px 24px;\n                border-radius: 20px;\n            }\n            .summary-grid {\n                grid-template-columns: 1fr;\n                gap: 20px;\n            }\n            h1 {\n                font-size: 28px;\n                margin-bottom: 30px;\n            }\n            .metric-value {\n                font-size: 24px;\n            }\n        }\n    </style>\n</head>\n<body>\n    <div class=\"container\">\n        <h1>Marketing Campaign Performance Report</h1>\n        \n        <h2>Campaign Summary</h2>\n        <div class=\"summary-grid\">\n            <div class=\"metric-card\">\n                <div class=\"metric-label\">Total Campaigns</div>\n                <div class=\"metric-value\">{{ $json.unique_count_Campaign }}</div>\n            </div>\n            <div class=\"metric-card\">\n                <div class=\"metric-label\">Total Customers Reached</div>\n                <div class=\"metric-value\">{{ $json.unique_count_Customer_ID }}</div>\n            </div>\n            <div class=\"metric-card\">\n                <div class=\"metric-label\">Total Clicks</div>\n                <div class=\"metric-value\">{{ $json.sum_Clicks }}</div>\n            </div>\n            <div class=\"metric-card\">\n                <div class=\"metric-label\">Total Conversions</div>\n                <div class=\"metric-value\">{{ $json.sum_Conversions }}</div>\n            </div>\n            <div class=\"metric-card\">\n                <div class=\"metric-label\">Total Spend</div>\n                <div class=\"metric-value\">{{ $json['sum_Spend_($)'] }}</div>\n            </div>\n        </div>\n        <div class=\"footer\">\n            <p>Report generated automatically via n8n automation</p>\n            <p>Last updated: {{ $json.lastUpdated }}</p>\n        </div>\n    </div>\n</body>\n</html>",
        "toRecipients": "rbreen@ynteractive.com",
        "additionalFields": {
          "bodyContentType": "html"
        }
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "id": "9z1nG9ReKLXU309r",
          "name": "Microsoft Outlook account 4"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "d9d8fce2-da0f-4ba4-be18-445f5c71a466",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1776,
        1296
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition",
        "numberInputs": 5
      },
      "typeVersion": 3.2
    },
    {
      "id": "446a50f7-8d42-40f9-9323-790ea93a4aa5",
      "name": "便签17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3136,
        480
      ],
      "parameters": {
        "width": 1984,
        "height": 128,
        "content": "## 📬 需要帮助或想自定义此工作流?"
      },
      "typeVersion": 1
    },
    {
      "id": "08007788-b10a-45c2-8d8e-44b31d0679cc",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3136,
        624
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 928,
        "content": "### 步骤 1:设置您的 Google Sheets 数据源"
      },
      "typeVersion": 1
    },
    {
      "id": "6020cd74-f930-4e34-bcf4-8bb51caaffcf",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        624
      ],
      "parameters": {
        "color": 3,
        "width": 768,
        "height": 928,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "babb9445-8793-4b44-8447-0ed788ca53a0",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2624,
        624
      ],
      "parameters": {
        "color": 5,
        "width": 672,
        "height": 928,
        "content": "#### 节点 3-7:数据分析节点"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Send Email Report1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sum Total Spend": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Sum Total Clicks": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Send Email Report1": {
      "main": [
        []
      ]
    },
    "Sum Total Conversions": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Count Unique Campaigns": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Count Unique Customers": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Google Sheets Data": {
      "main": [
        [
          {
            "node": "Count Unique Customers",
            "type": "main",
            "index": 0
          },
          {
            "node": "Count Unique Campaigns",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sum Total Clicks",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sum Total Conversions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sum Total Spend",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Google Sheets Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文档提取, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量13
分类2
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部链接
在 n8n.io 查看

分享此工作流