8
n8n 中文网amn8n.com

35 监控竞争对手财务状况

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 18 个节点。主要使用 Set, Code, Gmail, GoogleSheets, McpClientTool 等节点。 使用Bright Data MCP、OpenAI和Google Sheets监控竞争对手财务表现

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "tZhYQXv2WOoX0PvT",
  "meta": {
    "instanceId": "c38e3b8a7e4240e6cdca062743f016c1029f385bf40345b6291939dfd83bfd77",
    "templateCredsSetupCompleted": true
  },
  "name": "35 监控竞争对手财务状况",
  "tags": [],
  "nodes": [
    {
      "id": "df69b41c-28b1-457b-93e2-1c6523028d01",
      "name": "🚦 启动工作流(手动触发器)",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -60,
        20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9ebe6532-1865-4c87-a443-ed23157dc7fa",
      "name": "🔗 输入特斯拉的雅虎财经 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "50cdc310-34d9-4743-a943-f3ad55ab63b8",
              "name": "teslaURL",
              "type": "string",
              "value": "https://finance.yahoo.com/quote/TSLA/financials"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d96bdd1f-8866-4712-b593-92ba5d1a8d97",
      "name": "🤖 AI 代理:抓取特斯拉财务数据",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        420,
        20
      ],
      "parameters": {
        "text": "=Please scrape the latest financial data for Tesla, Inc. (TSLA) from Yahoo Finance for the latest quarter available. \n\nSearch URL : {{ $json.teslaURL }}\n\nInclude the following information:\n- Revenue for the latest quarter.\n- Total Income\n- Total Expenses\n- Earnings per Share (EPS) for the latest quarter.\n-  net margin for the latest quarter.\n- Profit (Net Income) for the latest quarter.\n\nplease dont give me tha summary of these above financial data.\nPlease provide a detailed breakdown of only  these above financial metrics nothing else.\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "8e8438ab-e793-4637-af83-6351f6c41068",
      "name": "🧠 OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        380,
        320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "kmqnyfHdWfA8k1KC",
          "name": "OpenAi account 3"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "be009492-2ff8-4d69-847f-64d7deb338e0",
      "name": "🌐 MCP 客户端工具",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        540,
        320
      ],
      "parameters": {
        "toolName": "web_data_yahoo_finance_business",
        "operation": "executeTool",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', ``, 'json') }}"
      },
      "credentials": {
        "mcpClientApi": {
          "id": "dGu6Ys11ijXSTxcV",
          "name": "MCP Client (STDIO) account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2d5d31c7-6f07-47c0-a365-93c64a868fe7",
      "name": "📊 从 Google Sheets 获取公司数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        900,
        20
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WvSWlWjowhz0amszpgv7CUBXjJHYZE9vuiVafgqG6tU/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1WvSWlWjowhz0amszpgv7CUBXjJHYZE9vuiVafgqG6tU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WvSWlWjowhz0amszpgv7CUBXjJHYZE9vuiVafgqG6tU/edit?usp=drivesdk",
          "cachedResultName": "My financial Data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "i899RBJ6SKiYYWwx",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "284d8508-67c0-4daa-9cbe-9c41679d542b",
      "name": "⚖️ 比较数据",
      "type": "n8n-nodes-base.code",
      "position": [
        1100,
        20
      ],
      "parameters": {
        "jsCode": "// Get the AI agent data (latest data)\nconst aiAgentData = $('🤖 AI Agent: Scrape Tesla Financial Data').first().json.output.financial_data;\n\n// Get the Google Sheet data (old data)\nconst googleSheetData = items[0].json; // Assuming Google Sheet data is in the first item\n\n// Prepare the comparison result\nconst comparisonResult = {\n  \"comparison\": [\n    {\n      \"metric\": \"Total Revenue\",\n      \"your_company_data\": `$${googleSheetData['Total Revenue']}`,\n      \"tesla_data\": aiAgentData.revenue.total_revenue,\n      \"result\": aiAgentData.revenue.total_revenue > `$${googleSheetData['Total Revenue']}` ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Quarter Estimate\",\n      \"your_company_data\": `$${googleSheetData['Quarter Estimate']}`,\n      \"tesla_data\": aiAgentData.revenue.quarter_value_estimate,\n      \"result\": aiAgentData.revenue.quarter_value_estimate > `$${googleSheetData['Quarter Estimate']}` ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Pretax Income\",\n      \"your_company_data\": `$${googleSheetData['Pretax Income']}`,\n      \"tesla_data\": aiAgentData.total_income.pretax_income,\n      \"result\": aiAgentData.total_income.pretax_income > `$${googleSheetData['Pretax Income']}` ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Basic EPS\",\n      \"your_company_data\": googleSheetData['Basic EPS'],\n      \"tesla_data\": aiAgentData.earnings_per_share.basic_eps,\n      \"result\": aiAgentData.earnings_per_share.basic_eps > googleSheetData['Basic EPS'] ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Diluted EPS\",\n      \"your_company_data\": googleSheetData['Diluted EPS'],\n      \"tesla_data\": aiAgentData.earnings_per_share.diluted_eps,\n      \"result\": aiAgentData.earnings_per_share.diluted_eps > googleSheetData['Diluted EPS'] ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Net Income\",\n      \"your_company_data\": `$${googleSheetData['Net Income']}`,\n      \"tesla_data\": aiAgentData.profit.net_income,\n      \"result\": aiAgentData.profit.net_income > `$${googleSheetData['Net Income']}` ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Net Margin\",\n      \"your_company_data\": `${googleSheetData['Net Margin'] * 100}%`,\n      \"tesla_data\": aiAgentData.margins.net_margin,\n      \"result\": parseFloat(aiAgentData.margins.net_margin) > googleSheetData['Net Margin'] ? \"Outperforming\" : \"Underperforming\"\n    },\n    {\n      \"metric\": \"Total Expenses\",\n      \"your_company_data\": `$${googleSheetData['Total Expenses']}`,\n      \"tesla_data\": aiAgentData.total_expenses.total_expenses,\n      \"result\": parseFloat(aiAgentData.total_expenses.total_expenses.replace(/[^\\d.-]/g, '')) < parseFloat(googleSheetData['Total Expenses']) ? \"Outperforming\" : \"Underperforming\"\n    }\n  ]\n};\n\n// Return the comparison result\nreturn [\n  {\n    json: comparisonResult\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "de22bb17-7a3d-4c33-8100-55175000900c",
      "name": "📧 将财务比较发送给团队",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        20
      ],
      "webhookId": "44c01443-c821-45c5-b537-2932037b311a",
      "parameters": {
        "sendTo": "shahkar.genai@gmail.com",
        "message": "=Hello team!\n\nThe comparison between us and tesla is given below:\n\nTotal Revenue: {{ $json.comparison[0].result }}\n\nQuarter Estimate: {{ $json.comparison[1].result }}\n\nPretax Income: {{ $json.comparison[2].result }}\n\nBasic EPS: {{ $json.comparison[3].result }}\n\nDiluted EPS: {{ $json.comparison[4].result }}\n\nNet Income: {{ $json.comparison[5].result }}\n\nNet Margin: {{ $json.comparison[6].result }}\n\nTotal Expenses: {{ $json.comparison[7].result }}",
        "options": {},
        "subject": "Financial Comparison: Your Company vs Tesla, Inc. (TSLA)",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "fZQRQuE7FmCr9daN",
          "name": "Gmail account 2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c12f86e7-b0bb-4f74-8678-e8c3774b7eed",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -500
      ],
      "parameters": {
        "color": 2,
        "width": 460,
        "height": 740,
        "content": "### 🔹 **第一部分:开始并输入财务数据 URL**"
      },
      "typeVersion": 1
    },
    {
      "id": "d6feb3e2-f701-4bc3-bb1f-4c170cbbd50f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -760
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 1000,
        "content": "### 🤖 **第二部分:AI 代理获取财务数据**"
      },
      "typeVersion": 1
    },
    {
      "id": "37e68e3f-5516-4a01-a619-b51e2c48b408",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -640
      ],
      "parameters": {
        "color": 6,
        "width": 440,
        "height": 880,
        "content": "### 📊 **第三部分:比较特斯拉与您公司的财务数据**"
      },
      "typeVersion": 1
    },
    {
      "id": "e33324fb-707d-4d28-88b1-a0496908e43b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        -560
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 800,
        "content": "### 📧 **第四部分:向团队发送比较邮件**"
      },
      "typeVersion": 1
    },
    {
      "id": "94281256-f5d4-4e9c-aa50-0437f2dedd20",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        -640
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 2660,
        "content": "### 🚀 **特斯拉财务表现抓取工作流**"
      },
      "typeVersion": 1
    },
    {
      "id": "6a498444-a484-4b15-9160-ab2b738560fb",
      "name": "便签说明5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        -560
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 240,
        "content": "## 如果您通过此链接加入Bright Data,我将获得少量佣金 - 感谢您为更多免费内容提供支持!"
      },
      "typeVersion": 1
    },
    {
      "id": "f419f2ec-2704-43e3-9f50-2c6d78ec5bbe",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        -980
      ],
      "parameters": {
        "color": 4,
        "width": 1300,
        "height": 320,
        "content": "======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "32991f65-99c8-45e8-9187-f902217e673b",
      "name": "自动修复输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserAutofixing",
      "position": [
        660,
        320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "bc506c4a-617d-4918-9ebd-e303529747f5",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        620,
        540
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "kmqnyfHdWfA8k1KC",
          "name": "OpenAi account 3"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ba558831-0955-425a-9f93-bdf5953a3af5",
      "name": "📦 将财务数据格式化为 JSON 输出",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        800,
        540
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"financial_data\": {\n    \"company\": \"Tesla, Inc.\",\n    \"quarter_end_date\": \"2024-09-30\",\n    \"revenue\": {\n      \"total_revenue\": \"$97.69 billion (annualized)\",\n      \"quarter_value_estimate\": \"$24.42 billion (approx.)\"\n    },\n    \"total_income\": {\n      \"pretax_income\": \"$8.99 billion\"\n    },\n    \"total_expenses\": {\n      \"total_expenses\": \"$89.93 billion (annualized)\"\n    },\n    \"earnings_per_share\": {\n      \"basic_eps\": \"$0.68\",\n      \"diluted_eps\": \"$0.62\"\n    },\n    \"profit\": {\n      \"net_income\": \"$7.13 billion\"\n    },\n    \"margins\": {\n      \"net_margin\": \"6.38% (annualized)\"\n    }\n  }\n}\n"
      },
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ab84de38-8755-4322-abd6-63f0516400d8",
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "⚖️ Compare Data": {
      "main": [
        [
          {
            "node": "📧 Send Financial Comparison to Team ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🌐 MCP Client Tool ": {
      "ai_tool": [
        [
          {
            "node": "🤖 AI Agent: Scrape Tesla Financial Data",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "🧠 OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "🤖 AI Agent: Scrape Tesla Financial Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Auto-fixing Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "🤖 AI Agent: Scrape Tesla Financial Data",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "🚦 Start Workflow (Manual Trigger)": {
      "main": [
        [
          {
            "node": "🔗 Enter Yahoo Finance URL for Tesla",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔗 Enter Yahoo Finance URL for Tesla": {
      "main": [
        [
          {
            "node": "🤖 AI Agent: Scrape Tesla Financial Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Get Company Data from Google Sheets": {
      "main": [
        [
          {
            "node": "⚖️ Compare Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📦 Format Financial data as Json Output": {
      "ai_outputParser": [
        [
          {
            "node": "Auto-fixing Output Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "🤖 AI Agent: Scrape Tesla Financial Data": {
      "main": [
        [
          {
            "node": "📊 Get Company Data from Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研, AI 摘要总结

需要付费吗?

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

工作流信息
难度等级
高级
节点数量18
分类2
节点类型11
难度说明

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

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

外部链接
在 n8n.io 查看

分享此工作流