8
n8n 中文网amn8n.com

使用 Ada AI 分析、解读和可视化多源数据

高级

这是一个自动化工作流,包含 25 个节点。主要使用 Set, Code, Gmail, MySql, Markdown 等节点。 使用 Ada AI 分析、解读和可视化多源数据

前置要求
  • Google 账号和 Gmail API 凭证
  • MySQL 数据库连接信息
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "806e76bc68769277cc91003cf60c5af8793416e570a07db359be1a94e4c0b217"
  },
  "nodes": [
    {
      "id": "78b49282-5384-4a85-aadf-f05fc08cfe7f",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -112
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 1536,
        "content": "## 数据源"
      },
      "typeVersion": 1
    },
    {
      "id": "bf8a1e18-4fcf-4ba5-ba20-ec534dbb3499",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        240
      ],
      "parameters": {
        "color": 4,
        "width": 656,
        "height": 976,
        "content": "## 选择您需要的技能"
      },
      "typeVersion": 1
    },
    {
      "id": "dd510d46-fb9d-4020-b675-cddb76dfbfc5",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1328,
        368
      ],
      "parameters": {
        "color": 4,
        "width": 336,
        "height": 848,
        "content": "## 输出"
      },
      "typeVersion": 1
    },
    {
      "id": "64975f75-6153-43a0-ad61-4bc8c69c0e33",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3584,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 3088,
        "height": 4672,
        "content": "## 概述"
      },
      "typeVersion": 1
    },
    {
      "id": "8f6a76db-8a9b-482f-91d6-919056845326",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        512
      ],
      "parameters": {
        "width": 512,
        "height": 1536,
        "content": "## 2️⃣ 设置凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "a207fbeb-3186-4116-920d-7c835c819af7",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2272,
        2880
      ],
      "parameters": {
        "width": 1088,
        "height": 224,
        "content": "## 咨询"
      },
      "typeVersion": 1
    },
    {
      "id": "ab5c1992-7fc4-497b-8fd1-af121a4cd31b",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2288,
        512
      ],
      "parameters": {
        "width": 1056,
        "height": 2336,
        "content": "## 1️⃣ 申请 API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "c29c4606-ab1b-42b8-bbf3-8c79d68a2a98",
      "name": "开始",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -432,
        608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a4d275ff-e4ff-4066-a4e0-f4d857f5e4c4",
      "name": "从数据库获取数据",
      "type": "n8n-nodes-base.mySql",
      "position": [
        0,
        800
      ],
      "parameters": {
        "query": "select * from orders limit 100",
        "options": {},
        "operation": "executeQuery"
      },
      "typeVersion": 2.5
    },
    {
      "id": "75fc8170-eec6-47c7-bd66-384d2f1a53a8",
      "name": "处理数据",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        336,
        608
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "809b1798-dcf6-42cc-8d8d-d258fa6d67fd",
      "name": "从 Google Sheets 获取数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        0,
        992
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 332281959,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IhUFreWCZFLAUaCP9ELBnvakg1xSs4CgqnSnMvgkGmM/edit#gid=332281959",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IhUFreWCZFLAUaCP9ELBnvakg1xSs4CgqnSnMvgkGmM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IhUFreWCZFLAUaCP9ELBnvakg1xSs4CgqnSnMvgkGmM/edit?usp=drivesdk",
          "cachedResultName": "example_data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "TYgnI9PXhFzSLNSk",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "0cf1ecaf-77a5-4c42-a8a4-c1ed05d1b044",
      "name": "从本地文件获取数据",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        -80,
        1184
      ],
      "parameters": {
        "options": {
          "dataPropertyName": "input_file"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "53f02952-806b-4023-9723-f30a35024b3f",
      "name": "从 xlsx 文件提取 JSON",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        112,
        1184
      ],
      "parameters": {
        "options": {},
        "operation": "xlsx",
        "binaryPropertyName": "input_file"
      },
      "typeVersion": 1
    },
    {
      "id": "02987176-ebb7-4fda-b5e3-fb99f023f381",
      "name": "DataAnalysis",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        608
      ],
      "parameters": {
        "url": "https://ada.im/api/platform_api/PythonDataAnalysis",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input_json",
              "value": "={{$json.data}}"
            },
            {
              "name": "query",
              "value": "What are the top three products in terms of sales in 2024? Analyze the gap between the top three products and the others from a statistical perspective."
            },
            {
              "name": "platform",
              "value": "n8n"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "34c0b0d3-197d-4966-936b-b7601530e325",
      "name": "DataInterpretation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        784
      ],
      "parameters": {
        "url": "https://ada.im/api/platform_api/DataInterpretation",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input_json",
              "value": "={{$json.data}}"
            },
            {
              "name": "query",
              "value": "Sales volume of each product in 2024"
            },
            {
              "name": "platform",
              "value": "n8n"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "typeVersion": 4.2
    },
    {
      "id": "50a3424f-7147-4d38-9cb3-2b90fed8a572",
      "name": "DataVisualization",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        960
      ],
      "parameters": {
        "url": "https://ada.im/api/platform_api/EchartsVisualization",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "input_json",
              "value": "={{$json.data}}"
            },
            {
              "name": "query",
              "value": "Use a pie chart to display the sales of each product in 2024, and a line chart to represent the total monthly sales of each product in 2024. Additionally, you can add some extra charts based on the data."
            },
            {
              "name": "platform",
              "value": "n8n"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "A1ydMlIrxdo5rBa4",
          "name": "Header Auth account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0d7f6c15-aef5-4b3a-81bc-b21a0a9f4c1d",
      "name": "转换为 HTML 文件",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        976,
        960
      ],
      "parameters": {
        "options": {
          "fileName": "chart.html"
        },
        "operation": "toText",
        "sourceProperty": "html",
        "binaryPropertyName": "chart"
      },
      "typeVersion": 1.1
    },
    {
      "id": "0454bd77-f7fc-4798-afa1-3f93a0e006d5",
      "name": "将 Markdown 转换为 HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        976,
        608
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {
          "tables": true,
          "simpleLineBreaks": true,
          "completeHTMLDocument": false
        },
        "markdown": "={{ $json.data.parseJson().data }}",
        "destinationKey": "html"
      },
      "typeVersion": 1
    },
    {
      "id": "6ffbdfb1-f72a-480b-82ae-c0fcdc881feb",
      "name": "将 Markdown 转换为 HTML 2",
      "type": "n8n-nodes-base.markdown",
      "position": [
        976,
        784
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {
          "tables": true,
          "simpleLineBreaks": true,
          "completeHTMLDocument": false
        },
        "markdown": "={{ $json.data.parseJson().data }}",
        "destinationKey": "html"
      },
      "typeVersion": 1
    },
    {
      "id": "f765788b-4efb-4daa-908c-84e653784156",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        2096
      ],
      "parameters": {
        "width": 512,
        "height": 1168,
        "content": "## 3️⃣ 试用技能"
      },
      "typeVersion": 1
    },
    {
      "id": "30aaf9f5-e935-4ddb-adcc-baff0ab5b101",
      "name": "发送 DataAnalysis 消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1456,
        608
      ],
      "webhookId": "6634ed2d-552c-4bf6-a7f2-bbdee8d61df4",
      "parameters": {
        "message": "={{ $json.html }}",
        "options": {},
        "subject": "n8n-email"
      },
      "typeVersion": 2.1
    },
    {
      "id": "a10921fc-2258-48d5-8f40-99bf495a082c",
      "name": "发送 DataInterpretation 消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1456,
        784
      ],
      "webhookId": "6634ed2d-552c-4bf6-a7f2-bbdee8d61df4",
      "parameters": {
        "sendTo": "cuifangxu1999@gmail.com",
        "message": "={{ $json.html }}",
        "options": {},
        "subject": "n8ntest"
      },
      "typeVersion": 2.1
    },
    {
      "id": "8fb14896-41b4-4eb1-8d4e-b70f3b97ad49",
      "name": "发送 DataVisualization",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1456,
        960
      ],
      "webhookId": "6634ed2d-552c-4bf6-a7f2-bbdee8d61df4",
      "parameters": {
        "sendTo": "cuifangxu1999@gmail.com",
        "message": "From n8n, please use a browser to open the HTML file in the attachment",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "=chart"
              }
            ]
          }
        },
        "subject": "n8ntest",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "b29b555a-bd5d-4a6f-8873-9027c13ae3ef",
      "name": "示例数据",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        608
      ],
      "parameters": {
        "jsCode": "const categories = [\n  'Electronics',\n  'Clothing & Fashion',\n  'Home & Furniture',\n  'Food & Beverages',\n  'Sports & Outdoors',\n  'Beauty & Personal Care'\n];\nconst regions = [\n  'North America',\n  'South America',\n  'Europe',\n  'Asia',\n  'Africa',\n  'Oceania',\n  'Middle East',\n  'Central Asia'\n];\n\nfunction randomDateWithin730Days() {\n  const now = new Date();\n  const daysAgo = Math.floor(Math.random() * 730);\n  now.setDate(now.getDate() - daysAgo);\n  return now.toISOString().slice(0, 10);\n}\n\nlet items = [];\nfor (let i = 0; i < 1000; i++) {\n  items.push({\n    json: {\n      order_date: randomDateWithin730Days(),\n      product_category: categories[Math.floor(Math.random() * categories.length)],\n      region: regions[Math.floor(Math.random() * regions.length)],\n      sales_amount: (50 + Math.random() * 49950).toFixed(2)\n    }\n  });\n}\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "7213ec38-425d-4020-9776-5750c286aa65",
      "name": "处理可视化数据",
      "type": "n8n-nodes-base.set",
      "position": [
        768,
        960
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ab328d59-6af7-4084-9c75-a7b5c5673168",
              "name": "html",
              "type": "string",
              "value": "={{ JSON.parse($json.data).data }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "pinData": {},
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Sample Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sample Data": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DataAnalysis": {
      "main": [
        [
          {
            "node": "Convert markdown to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Data": {
      "main": [
        [
          {
            "node": "DataVisualization",
            "type": "main",
            "index": 0
          },
          {
            "node": "DataAnalysis",
            "type": "main",
            "index": 0
          },
          {
            "node": "DataInterpretation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DataVisualization": {
      "main": [
        [
          {
            "node": "Process Visualization Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DataInterpretation": {
      "main": [
        [
          {
            "node": "Convert markdown to HTML 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to HTML File": {
      "main": [
        [
          {
            "node": "Send DataVisualization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data from database": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send DataVisualization": {
      "main": [
        []
      ]
    },
    "Convert markdown to HTML": {
      "main": [
        [
          {
            "node": "Send DataAnalysis message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data from local file": {
      "main": [
        [
          {
            "node": "Extract JSON from xlsx file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send DataAnalysis message": {
      "main": [
        []
      ]
    },
    "Convert markdown to HTML 2": {
      "main": [
        [
          {
            "node": "Send DataInterpretation message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Visualization Data": {
      "main": [
        [
          {
            "node": "Convert to HTML File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract JSON from xlsx file": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data from Google Sheets": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send DataInterpretation message": {
      "main": [
        []
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量25
分类-
节点类型13
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流