8
n8n 中文网amn8n.com

房地产

中级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 8 个节点。主要使用 Code, Telegram, ScheduleTrigger, ScrapegraphAi 等节点。 使用ScrapeGraphAI自动发送Zillow房地产列表到Telegram

前置要求
  • Telegram Bot Token
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "cmnzMjCOzadRrYT9",
  "meta": {
    "instanceId": "521567c5f495f323b77849c4cfd0c9f4f2396c986e324e0e66c8425b6f124744",
    "templateCredsSetupCompleted": true
  },
  "name": "房地产",
  "tags": [],
  "nodes": [
    {
      "id": "6a1fbe16-eb98-4106-b88a-9a069ac78a15",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        700,
        820
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0c1aa147-5e3f-4a59-9f0f-2a115f03ffb7",
      "name": "ScrapegraphAI",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        1380,
        820
      ],
      "parameters": {
        "userPrompt": "Extract real estate listings from this site. Use the following schema for response { \"address\": \"123 Main St, Columbus, OH 43215\", \"price\": \"$450,000\", \"beds\": \"3\", \"baths\": \"2\", \"sqft\": \"1,850\", \"lot_size\": \"0.25 acres\", \"year_built\": \"1995\", \"property_type\": \"Single Family\", \"listing_url\": \"https://www.zillow.com/homedetails/123-Main-St...\" }",
        "websiteUrl": "https://www.zillow.com/homes/?category=SEMANTIC&searchQueryState=%7B%22filterState%22%3A%7B%22isRecentlySold%22%3A%7B%22value%22%3Afalse%7D%2C%22isPreMarketPreForeclosure%22%3A%7B%22value%22%3Afalse%7D%2C%22isPreMarketForeclosure%22%3A%7B%22value%22%3Afalse%7D%2C%22isForRent%22%3A%7B%22value%22%3Afalse%7D%2C%22isForSaleByAgent%22%3A%7B%22value%22%3Atrue%7D%2C%22isForSaleByOwner%22%3A%7B%22value%22%3Atrue%7D%2C%22isAuction%22%3A%7B%22value%22%3Atrue%7D%2C%22isComingSoon%22%3A%7B%22value%22%3Atrue%7D%2C%22isForSaleForeclosure%22%3A%7B%22value%22%3Atrue%7D%2C%22isNewConstruction%22%3A%7B%22value%22%3Atrue%7D%2C%22sortSelection%22%3A%7B%22value%22%3A%22globalrelevanceex%22%7D%7D%2C%22regionSelection%22%3A%5B%7B%22regionId%22%3A44%7D%5D%2C%22usersSearchTerm%22%3A%22Ohio%22%7D"
      },
      "credentials": {
        "scrapegraphAIApi": {
          "id": "",
          "name": ""
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b9523259-cabb-41a4-9e55-9a106c4abc28",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "notes": "Hey this is where \nyou \nformat results ",
      "position": [
        2140,
        820
      ],
      "parameters": {
        "jsCode": "// Get the input data\nconst inputData = $input.all()[0].json;\n// Extract listings array from result - FIXED: use real_estate_listings\nconst listings = inputData.result.real_estate_listings || inputData.result.listings || inputData.result.properties || inputData.listings || [];\n\nfunction formatForTelegram(listing) {\n  const {\n    address,\n    price,\n    beds,\n    baths,\n    sqft,\n    lot_size,\n    year_built,\n    year_bult, // Note: there's a typo in your data (year_bult instead of year_built)\n    property_type,\n    listing_url\n  } = listing;\n\n  // Handle null/undefined values\n  const safeAddress = address || 'Address not available';\n  const safePrice = price || 'Price not listed';\n  const safeBeds = beds || 'N/A';\n  const safeBaths = baths || 'N/A';\n  const safeSqft = sqft || 'N/A';\n  const safeLotSize = lot_size && lot_size !== '[null]' ? lot_size : null;\n  // Handle both year_built and year_bult (typo in data)\n  const safeYearBuilt = (year_built || year_bult) && (year_built || year_bult) !== 'N/A' ? (year_built || year_bult) : null;\n  const safePropertyType = property_type || 'Property';\n  const safeUrl = listing_url || '#';\n\n  let message = `🏠 **NEW ${safePropertyType.toUpperCase()} LISTING**\n\n📍 **Address:** ${safeAddress}\n💰 **Price:** ${safePrice}\n🛏️ **Beds:** ${safeBeds} | 🚿 **Baths:** ${safeBaths}\n📐 **Size:** ${safeSqft} sqft`;\n\n  // Add optional fields if available\n  if (safeLotSize) {\n    message += `\\n🌱 **Lot Size:** ${safeLotSize}`;\n  }\n  \n  if (safeYearBuilt) {\n    message += `\\n🗓️ **Year Built:** ${safeYearBuilt}`;\n  }\n\n  message += `\\n\\n🔗 [View Full Details](${safeUrl})\n\n━━━━━━━━━━━━━━━━━━━━━━\n🕐 Listed: ${new Date().toLocaleString()}`;\n\n  return message;\n}\n\n// Debug log\nconsole.log(`Found ${listings.length} listings`);\n\n// Return each listing as separate execution with formatted Telegram text\nreturn listings.map(listing => ({\n  json: {\n    text: formatForTelegram(listing),\n    // Keep original data for reference if needed\n    address: listing.address,\n    price: listing.price,\n    beds: listing.beds,\n    baths: listing.baths,\n    sqft: listing.sqft,\n    lot_size: listing.lot_size,\n    year_built: listing.year_built || listing.year_bult, // Handle typo\n    property_type: listing.property_type,\n    listing_url: listing.listing_url\n  }\n}));"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "19302435-3112-4136-a8a3-95ff5da1c8ef",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# 步骤 2:ScrapeGraphAI 节点 🤖"
      },
      "typeVersion": 1
    },
    {
      "id": "0e801cc4-a853-4fb1-a0c6-330943996f63",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# 步骤 3:格式化响应 🧱"
      },
      "typeVersion": 1
    },
    {
      "id": "76a1aff0-92cc-4bb0-84ec-525ed7a0cdf2",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# 步骤 1:触发器 ⏱️"
      },
      "typeVersion": 1
    },
    {
      "id": "151eaaf9-a11f-42dc-8f08-3d4e6c7a5a03",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2680,
        460
      ],
      "parameters": {
        "color": 5,
        "width": 574.9363634768473,
        "height": 530.4701664623029,
        "content": "# 步骤 4:Telegram 节点 📧"
      },
      "typeVersion": 1
    },
    {
      "id": "37d06314-47d4-4705-a52e-501caff0817f",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "maxTries": 5,
      "position": [
        2920,
        820
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "chatId": "@housingprices",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "",
          "name": ""
        }
      },
      "executeOnce": false,
      "retryOnFail": true,
      "typeVersion": 1.2,
      "alwaysOutputData": false,
      "waitBetweenTries": 5000
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6a32d4c5-dad4-442c-a6d6-19743b661a8c",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram": {
      "main": [
        []
      ]
    },
    "ScrapegraphAI": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "ScrapegraphAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流