8
n8n 中文网amn8n.com

我的工作流程2

中级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 12 个节点。主要使用 If, Code, Telegram, HttpRequest, GoogleSheets 等节点。 使用ScrapeGraphAI和Telegram监控LoopNet商业地产机会

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "instanceId": "f4b0efaa33080e7774e0d9285c40c7abcd2c6f7cf1a8b901fa7106170dd4cda3",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流程 2",
  "tags": [
    {
      "id": "DxXGubfBzRKh6L8T",
      "name": "Revenue Optimization",
      "createdAt": "2025-07-25T16:24:30.370Z",
      "updatedAt": "2025-07-25T16:24:30.370Z"
    },
    {
      "id": "IxkcJ2IpYIxivoHV",
      "name": "Content Strategy",
      "createdAt": "2025-07-25T12:57:37.677Z",
      "updatedAt": "2025-07-25T12:57:37.677Z"
    },
    {
      "id": "PAKIJ2Mm9EvRcR3u",
      "name": "Trend Monitoring",
      "createdAt": "2025-07-25T12:57:37.670Z",
      "updatedAt": "2025-07-25T12:57:37.670Z"
    },
    {
      "id": "YtfXmaZk44MYedPO",
      "name": "Dynamic Pricing",
      "createdAt": "2025-07-25T16:24:30.369Z",
      "updatedAt": "2025-07-25T16:24:30.369Z"
    },
    {
      "id": "wJ30mjhtrposO8Qt",
      "name": "Simple RAG",
      "createdAt": "2025-07-28T12:55:14.424Z",
      "updatedAt": "2025-07-28T12:55:14.424Z"
    }
  ],
  "nodes": [
    {
      "id": "b3039a5a-fac6-42bc-8165-df16a3a3e610",
      "name": "📋 计划信息",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        144
      ],
      "parameters": {
        "color": 2,
        "width": 400,
        "height": 852,
        "content": "# 每日 CRE 扫描器 ⏰"
      },
      "typeVersion": 1
    },
    {
      "id": "072af1a6-fc7e-435e-bd7e-b68e5eeb6d84",
      "name": "每日 CRE 扫描器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1008,
        832
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5239bd82-fc3a-42df-bea8-40e1f0d2c01b",
      "name": "📋 数据收集",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        144
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 852,
        "content": "# CRE 数据收集器 🕷️"
      },
      "typeVersion": 1
    },
    {
      "id": "22906cc4-e61a-440d-8a62-61c0633549bb",
      "name": "CRE 数据收集器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        816
      ],
      "parameters": {
        "url": "https://api.scrapegraphai.com/v1/smartscraper",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "headerAuth",
        "bodyParameters": {
          "parameters": [
            {
              "name": "website_url",
              "value": "https://www.loopnet.com/search/commercial-real-estate/"
            },
            {
              "name": "user_prompt",
              "value": "Extract commercial real estate listings: property type, size, location, price, lease rate, contact info"
            },
            {
              "name": "output_schema",
              "value": "{\"listings\": [{\"id\": \"string\", \"type\": \"string\", \"size_sqft\": \"number\", \"location\": \"string\", \"price\": \"number\", \"lease_rate\": \"number\", \"contact\": \"string\"}]}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "131f2431-f6f1-44b7-87ef-d0cdf7690f3e",
      "name": "📋 分析引擎",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        144
      ],
      "parameters": {
        "color": 4,
        "width": 400,
        "height": 852,
        "content": "# CRE 分析器和仪表板 📊"
      },
      "typeVersion": 1
    },
    {
      "id": "702d76c3-3229-446b-adaf-2c0d8e751121",
      "name": "CRE 分析器和仪表板",
      "type": "n8n-nodes-base.code",
      "position": [
        -192,
        864
      ],
      "parameters": {
        "jsCode": "// Simplified CRE Analysis & Dashboard\nconst scrapedData = $input.all()[0].json;\nconst listings = scrapedData.listings || [];\n\n// Core analysis\nconst analysis = {\n  total_listings: listings.length,\n  avg_lease_rate: 0,\n  property_types: {},\n  top_locations: {},\n  opportunities: [],\n  alerts: []\n};\n\n// Process listings\nlet totalRate = 0;\nlet rateCount = 0;\n\nlistings.forEach(listing => {\n  // Track property types\n  const type = listing.type || 'Unknown';\n  analysis.property_types[type] = (analysis.property_types[type] || 0) + 1;\n  \n  // Track locations\n  const location = listing.location || 'Unknown';\n  analysis.top_locations[location] = (analysis.top_locations[location] || 0) + 1;\n  \n  // Calculate average rates\n  if (listing.lease_rate) {\n    totalRate += listing.lease_rate;\n    rateCount++;\n  }\n  \n  // Identify opportunities (below market rate)\n  if (listing.lease_rate && listing.lease_rate < 20) {\n    analysis.opportunities.push({\n      id: listing.id,\n      type: listing.type,\n      location: listing.location,\n      rate: listing.lease_rate,\n      size: listing.size_sqft,\n      opportunity: 'Below Market Rate'\n    });\n  }\n});\n\nanalysis.avg_lease_rate = rateCount > 0 ? (totalRate / rateCount).toFixed(2) : 0;\n\n// Generate alerts\nif (analysis.opportunities.length > 10) {\n  analysis.alerts.push({\n    type: 'High Opportunity Count',\n    message: `${analysis.opportunities.length} below-market properties found`,\n    priority: 'High'\n  });\n}\n\nif (analysis.avg_lease_rate > 30) {\n  analysis.alerts.push({\n    type: 'Rate Alert',\n    message: `Average lease rate (${analysis.avg_lease_rate}) above $30/sqft`,\n    priority: 'Medium'\n  });\n}\n\n// Create dashboard summary\nconst dashboard = {\n  generated_at: new Date().toISOString(),\n  market_summary: {\n    total_properties: analysis.total_listings,\n    avg_lease_rate: `${analysis.avg_lease_rate}/sqft`,\n    opportunities_found: analysis.opportunities.length,\n    active_alerts: analysis.alerts.length\n  },\n  top_property_types: Object.entries(analysis.property_types)\n    .sort(([,a], [,b]) => b - a)\n    .slice(0, 5)\n    .map(([type, count]) => ({ type, count })),\n  top_locations: Object.entries(analysis.top_locations)\n    .sort(([,a], [,b]) => b - a)\n    .slice(0, 5)\n    .map(([location, count]) => ({ location, count })),\n  priority_opportunities: analysis.opportunities\n    .sort((a, b) => a.rate - b.rate)\n    .slice(0, 10),\n  alerts: analysis.alerts,\n  next_actions: [\n    analysis.opportunities.length > 0 ? `Review ${analysis.opportunities.length} opportunities` : 'No immediate opportunities',\n    analysis.alerts.length > 0 ? `Address ${analysis.alerts.length} alerts` : 'No alerts requiring action',\n    'Update market analysis tomorrow'\n  ]\n};\n\nconsole.log(`CRE Analysis Complete: ${dashboard.market_summary.total_properties} properties, ${dashboard.market_summary.opportunities_found} opportunities`);\n\nreturn [{ json: dashboard }];"
      },
      "typeVersion": 2
    },
    {
      "id": "422fb0a3-a654-4239-bcf4-3da927626df6",
      "name": "📋 决策逻辑",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        144
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 852,
        "content": "# 机会检查 🎯"
      },
      "typeVersion": 1
    },
    {
      "id": "9fcce7ef-60c1-422e-9e0c-de5f684d3bdb",
      "name": "检查机会",
      "type": "n8n-nodes-base.if",
      "position": [
        192,
        848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "has-opportunities",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.market_summary.opportunities_found }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "864ba85a-3b21-4bde-a6b2-686368436e6d",
      "name": "📋 Telegram 设置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -176
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 852,
        "content": "# 发送机会警报 📱"
      },
      "typeVersion": 1
    },
    {
      "id": "b4b5cccf-a7da-403f-a7fc-13226b929040",
      "name": "发送机会警报",
      "type": "n8n-nodes-base.telegram",
      "position": [
        608,
        544
      ],
      "webhookId": "10a9dc8f-552a-47e6-9f03-d11b18524867",
      "parameters": {
        "operation": "send"
      },
      "typeVersion": 1.2
    },
    {
      "id": "4ce23013-8b82-439a-8e33-89291516078c",
      "name": "📋 数据记录",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        672
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 916,
        "content": "# 记录到 Google Sheets 📈"
      },
      "typeVersion": 1
    },
    {
      "id": "501df296-9ece-4f93-ac15-d6b753c10813",
      "name": "记录到Google表格",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        1456
      ],
      "parameters": {
        "resource": "spreadsheet",
        "operation": "appendOrUpdate"
      },
      "typeVersion": 4.4
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3d0f65de-749a-42e4-bbfc-b7073454c025",
  "connections": {
    "Daily CRE Scanner": {
      "main": [
        [
          {
            "node": "CRE Data Collector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRE Data Collector": {
      "main": [
        [
          {
            "node": "CRE Analyzer & Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Opportunities": {
      "main": [
        [
          {
            "node": "Send Opportunity Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRE Analyzer & Dashboard": {
      "main": [
        [
          {
            "node": "Check for Opportunities",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流