8
n8n 中文网amn8n.com

酒店房间价格检查器

高级

这是一个Market Research领域的自动化工作流,包含 29 个节点。主要使用 If, Code, Merge, EmailSend, HttpRequest 等节点。 酒店价格下降自动提醒(含邮件通知和数据库追踪)

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "32sZD8EotVPD5r21",
  "meta": {
    "instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
    "templateCredsSetupCompleted": true
  },
  "name": "酒店房间价格检查器",
  "tags": [],
  "nodes": [
    {
      "id": "4ee06ed2-858c-451d-80d1-50e5149f8be3",
      "name": "定时任务 - 每6小时",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "Triggers price check automatically every 6 hours to monitor rate changes",
      "position": [
        -2112,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a1be7480-2816-4d1a-b64d-24a4d123f9e5",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        -192
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 396,
        "content": "## ⏰ 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "566c0b0a-7671-4ee0-a248-b9ffb8e90d55",
      "name": "加载酒店列表",
      "type": "n8n-nodes-base.code",
      "notes": "Loads list of hotels to monitor from database or configuration",
      "position": [
        -1888,
        64
      ],
      "parameters": {
        "jsCode": "// List of hotels to monitor\n// In production, this would come from a database\nconst hotelsToMonitor = [\n  {\n    hotelId: 'hotel_001',\n    hotelName: 'Grand Plaza Hotel',\n    location: 'New York, USA',\n    roomType: 'Deluxe Suite',\n    bookingUrl: 'https://booking.com/hotel-001',\n    apiEndpoint: 'https://api.hotelbooking.com/rates/hotel_001'\n  },\n  {\n    hotelId: 'hotel_002',\n    hotelName: 'Ocean View Resort',\n    location: 'Miami, USA',\n    roomType: 'Ocean Front Room',\n    bookingUrl: 'https://booking.com/hotel-002',\n    apiEndpoint: 'https://api.hotelbooking.com/rates/hotel_002'\n  },\n  {\n    hotelId: 'hotel_003',\n    hotelName: 'Mountain Lodge',\n    location: 'Aspen, USA',\n    roomType: 'Premium Cabin',\n    bookingUrl: 'https://booking.com/hotel-003',\n    apiEndpoint: 'https://api.hotelbooking.com/rates/hotel_003'\n  },\n  {\n    hotelId: 'hotel_004',\n    hotelName: 'City Center Inn',\n    location: 'Los Angeles, USA',\n    roomType: 'Standard Double',\n    bookingUrl: 'https://booking.com/hotel-004',\n    apiEndpoint: 'https://api.hotelbooking.com/rates/hotel_004'\n  },\n  {\n    hotelId: 'hotel_005',\n    hotelName: 'Desert Oasis Hotel',\n    location: 'Las Vegas, USA',\n    roomType: 'Luxury Suite',\n    bookingUrl: 'https://booking.com/hotel-005',\n    apiEndpoint: 'https://api.hotelbooking.com/rates/hotel_005'\n  }\n];\n\nreturn hotelsToMonitor.map(hotel => ({\n  json: {\n    ...hotel,\n    checkTimestamp: new Date().toISOString(),\n    checkDate: new Date().toLocaleDateString('en-US', { \n      year: 'numeric', \n      month: 'long', \n      day: 'numeric' \n    })\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "89a5c7bd-ef50-4a9c-9970-31eca24fe4ae",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -144
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 348,
        "content": "## 🏨 酒店列表"
      },
      "typeVersion": 1
    },
    {
      "id": "1022f8d7-e6d9-4641-8f54-6f9e8345f928",
      "name": "从API获取当前价格",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Retrieves real-time pricing data from hotel booking API",
      "position": [
        -1680,
        64
      ],
      "parameters": {
        "url": "={{ $json.apiEndpoint }}",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "05fee65a-e5f1-455d-b3d3-fc1d8cc35099",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        -176
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 380,
        "content": "## 💰 价格API"
      },
      "typeVersion": 1
    },
    {
      "id": "6721055e-ee7d-475f-a06b-30897d37c293",
      "name": "解析价格数据",
      "type": "n8n-nodes-base.code",
      "notes": "Extracts and formats current price information from API response",
      "position": [
        -1456,
        64
      ],
      "parameters": {
        "jsCode": "// Parse API response and extract price\n// Since we're simulating, generate random prices\nconst hotelData = $('Load Hotel List').item.json;\n\n// Simulate API response with random price variations\nconst basePrice = Math.floor(Math.random() * (500 - 150 + 1)) + 150;\nconst priceVariation = Math.floor(Math.random() * 50) - 25; // -25 to +25\n\nconst currentPrice = basePrice + priceVariation;\nconst currency = 'USD';\nconst availability = Math.random() > 0.2 ? 'Available' : 'Limited';\n\nreturn {\n  json: {\n    hotelId: hotelData.hotelId,\n    hotelName: hotelData.hotelName,\n    location: hotelData.location,\n    roomType: hotelData.roomType,\n    bookingUrl: hotelData.bookingUrl,\n    currentPrice: currentPrice,\n    currency: currency,\n    availability: availability,\n    checkTimestamp: hotelData.checkTimestamp,\n    checkDate: hotelData.checkDate,\n    pricePerNight: currentPrice,\n    taxesIncluded: true\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "6f4a0e90-9da5-4a77-b307-9457186ac341",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1488,
        -192
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 396,
        "content": "## 📊 数据解析"
      },
      "typeVersion": 1
    },
    {
      "id": "e3731717-d4b4-429f-838a-81fdb625f1b5",
      "name": "从数据库获取历史价格",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Retrieves last recorded price from database for comparison",
      "position": [
        -1232,
        64
      ],
      "parameters": {
        "url": "https://your-database-api.com/prices/history",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        },
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "hotel_id",
              "value": "={{ $json.hotelId }}"
            },
            {
              "name": "room_type",
              "value": "={{ $json.roomType }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "01becb4a-1f77-42e6-9c4f-baffbfe89dd9",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 444,
        "content": "## 🗄️ 数据库查询"
      },
      "typeVersion": 1
    },
    {
      "id": "4c56305a-577a-4078-9480-67247af82062",
      "name": "价格比较",
      "type": "n8n-nodes-base.code",
      "notes": "Calculates price difference and percentage change from previous check",
      "position": [
        -1008,
        64
      ],
      "parameters": {
        "jsCode": "// Compare current price with previous price\nconst currentData = $('Parse Price Data').item.json;\nconst currentPrice = currentData.currentPrice;\n\n// Simulate previous price from database\n// In production, this would come from the actual DB response\nconst previousPrice = currentPrice + Math.floor(Math.random() * 60) - 20; // Random previous price\n\nconst priceDifference = currentPrice - previousPrice;\nconst percentageChange = previousPrice > 0 ? ((priceDifference / previousPrice) * 100).toFixed(2) : 0;\nconst priceChanged = priceDifference !== 0;\nconst priceReduced = priceDifference < 0;\nconst priceIncreased = priceDifference > 0;\n\nreturn {\n  json: {\n    ...currentData,\n    previousPrice: previousPrice,\n    currentPrice: currentPrice,\n    priceDifference: priceDifference,\n    percentageChange: percentageChange,\n    priceChanged: priceChanged,\n    priceReduced: priceReduced,\n    priceIncreased: priceIncreased,\n    changeDirection: priceReduced ? 'decreased' : (priceIncreased ? 'increased' : 'unchanged'),\n    savingsAmount: priceReduced ? Math.abs(priceDifference) : 0\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "024fba14-4c8a-4036-9236-a4073d7be5fb",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -224
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 460,
        "content": "## 🔍 价格比较"
      },
      "typeVersion": 1
    },
    {
      "id": "b209b7b7-d4ba-4b37-85f3-f11b3eac630f",
      "name": "检查价格是否降低",
      "type": "n8n-nodes-base.if",
      "notes": "Filters only hotels where price has decreased to send alerts",
      "position": [
        -800,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "price-reduced-check",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.priceReduced }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "73133073-2222-4af6-9337-b572e9323058",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -112
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 332,
        "content": "## ✅ 价格过滤器"
      },
      "typeVersion": 1
    },
    {
      "id": "d1c8b9af-4626-4cc5-a72c-06b5ec68a126",
      "name": "格式化提醒邮件",
      "type": "n8n-nodes-base.code",
      "notes": "Creates formatted HTML email with price comparison and booking details",
      "position": [
        -560,
        -32
      ],
      "parameters": {
        "jsCode": "// Format data for alert email\nconst data = $input.item.json;\n\nconst emailSubject = `🎉 Price Drop Alert: ${data.hotelName} - Save $${data.savingsAmount}!`;\n\nconst emailBody = `\n<html>\n<head>\n  <style>\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }\n    .container { max-width: 600px; margin: 0 auto; padding: 20px; }\n    .header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; text-align: center; border-radius: 10px 10px 0 0; }\n    .content { background: #f9f9f9; padding: 30px; border-radius: 0 0 10px 10px; }\n    .price-box { background: white; padding: 20px; margin: 20px 0; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }\n    .old-price { text-decoration: line-through; color: #999; font-size: 18px; }\n    .new-price { color: #22c55e; font-size: 32px; font-weight: bold; }\n    .savings { background: #22c55e; color: white; padding: 10px 20px; border-radius: 5px; display: inline-block; margin: 10px 0; }\n    .details { margin: 20px 0; }\n    .detail-row { padding: 10px 0; border-bottom: 1px solid #eee; }\n    .label { font-weight: bold; color: #667eea; }\n    .cta-button { background: #667eea; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block; margin: 20px 0; }\n    .footer { text-align: center; color: #999; margin-top: 30px; font-size: 12px; }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>🏨 Hotel Price Drop Alert!</h1>\n      <p>Great news! A price reduction has been detected</p>\n    </div>\n    <div class=\"content\">\n      <h2>${data.hotelName}</h2>\n      <p><strong>📍 Location:</strong> ${data.location}</p>\n      <p><strong>🛏️ Room Type:</strong> ${data.roomType}</p>\n      \n      <div class=\"price-box\">\n        <p><span class=\"label\">Previous Price:</span> <span class=\"old-price\">$${data.previousPrice} ${data.currency}</span></p>\n        <p><span class=\"label\">Current Price:</span> <span class=\"new-price\">$${data.currentPrice} ${data.currency}</span></p>\n        <div class=\"savings\">💰 Save $${data.savingsAmount} (${Math.abs(data.percentageChange)}% OFF)</div>\n      </div>\n      \n      <div class=\"details\">\n        <div class=\"detail-row\">\n          <span class=\"label\">Availability:</span> ${data.availability}\n        </div>\n        <div class=\"detail-row\">\n          <span class=\"label\">Price Per Night:</span> $${data.pricePerNight} ${data.currency}\n        </div>\n        <div class=\"detail-row\">\n          <span class=\"label\">Taxes:</span> ${data.taxesIncluded ? 'Included' : 'Not Included'}\n        </div>\n        <div class=\"detail-row\">\n          <span class=\"label\">Checked On:</span> ${data.checkDate}\n        </div>\n      </div>\n      \n      <center>\n        <a href=\"${data.bookingUrl}\" class=\"cta-button\">Book Now & Save!</a>\n      </center>\n      \n      <p style=\"margin-top: 20px; padding: 15px; background: #fff3cd; border-left: 4px solid #ffc107; border-radius: 4px;\">\n        ⚠️ <strong>Act Fast!</strong> Prices can change at any time. This deal might not last long.\n      </p>\n    </div>\n    <div class=\"footer\">\n      <p>This is an automated price alert from your Hotel Price Monitoring System</p>\n      <p>You're receiving this because you're monitoring ${data.hotelName}</p>\n    </div>\n  </div>\n</body>\n</html>\n`;\n\nreturn {\n  json: {\n    ...data,\n    emailSubject: emailSubject,\n    emailBody: emailBody,\n    alertType: 'price_reduction',\n    urgencyLevel: Math.abs(data.percentageChange) > 20 ? 'high' : 'medium'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "db1d5f57-2f0e-4b7f-82a1-b29d219dab34",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        -256
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 268,
        "content": "## 📧 邮件格式化"
      },
      "typeVersion": 1
    },
    {
      "id": "7cfa40a4-8201-4a19-b7fa-cff35c636ffe",
      "name": "发送邮件给旅行代理",
      "type": "n8n-nodes-base.emailSend",
      "notes": "Sends price drop alert email to travel agent with all details",
      "position": [
        -352,
        -32
      ],
      "webhookId": "f773dc8e-659e-4ee0-a3f8-cd52294c43cf",
      "parameters": {
        "options": {},
        "subject": "={{ $json.emailSubject }}",
        "toEmail": "travelagent@agency.com",
        "fromEmail": "alerts@hotelpricemonitor.com"
      },
      "credentials": {
        "smtp": {
          "id": "G1kyF8cSWTZ4vouN",
          "name": "SMTP -test"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "59598261-84cb-49b5-ad85-15572316d478",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -256
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 268,
        "content": "## 📮 邮件发送"
      },
      "typeVersion": 1
    },
    {
      "id": "01ed82a5-104f-4282-844f-faf5d4bd872a",
      "name": "记录提醒已发送",
      "type": "n8n-nodes-base.code",
      "notes": "Records alert delivery for tracking and audit purposes",
      "position": [
        -128,
        -32
      ],
      "parameters": {
        "jsCode": "// Log successful alert\nconst data = $input.item.json;\n\nreturn {\n  json: {\n    hotelId: data.hotelId,\n    hotelName: data.hotelName,\n    alertSent: true,\n    alertTimestamp: new Date().toISOString(),\n    previousPrice: data.previousPrice,\n    currentPrice: data.currentPrice,\n    savingsAmount: data.savingsAmount,\n    percentageChange: data.percentageChange,\n    recipientEmail: 'travelagent@agency.com',\n    alertType: 'price_reduction'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "bc82882c-6e33-47ed-b91a-f1eeb426908d",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -272
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 284,
        "content": "## 📝 提醒日志记录"
      },
      "typeVersion": 1
    },
    {
      "id": "5c98bfac-f475-4f97-b359-c6d2a1b88086",
      "name": "记录无需提醒",
      "type": "n8n-nodes-base.code",
      "notes": "Records check where no alert was needed (price unchanged or increased)",
      "position": [
        -560,
        160
      ],
      "parameters": {
        "jsCode": "// Log no change detected\nconst data = $input.item.json;\n\nreturn {\n  json: {\n    hotelId: data.hotelId,\n    hotelName: data.hotelName,\n    alertSent: false,\n    checkTimestamp: new Date().toISOString(),\n    previousPrice: data.previousPrice,\n    currentPrice: data.currentPrice,\n    priceChanged: data.priceChanged,\n    changeDirection: data.changeDirection,\n    reason: data.priceIncreased ? 'price_increased' : 'no_change'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "461d09c9-0695-4ac8-bd8b-6f1b732a8b32",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        304
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 140,
        "content": "## 📋 无提醒日志"
      },
      "typeVersion": 1
    },
    {
      "id": "5c074f64-4562-4cc6-adb4-6dd9e5d07ba3",
      "name": "合并所有日志",
      "type": "n8n-nodes-base.merge",
      "notes": "Combines logs from both alert and no-alert paths",
      "position": [
        -352,
        160
      ],
      "parameters": {
        "mode": "combine",
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "c2c40b1d-d5cd-4221-9395-54eb169a262a",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        304
      ],
      "parameters": {
        "color": 6,
        "width": 200,
        "height": 140,
        "content": "## 🔀 日志合并"
      },
      "typeVersion": 1
    },
    {
      "id": "400a11eb-2dc0-425e-a167-98312b3f8173",
      "name": "更新数据库中的价格",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Updates database with latest price for future comparisons",
      "position": [
        -128,
        160
      ],
      "parameters": {
        "url": "https://your-database-api.com/prices/update",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "hotel_id",
              "value": "={{ $('Parse Price Data').item.json.hotelId }}"
            },
            {
              "name": "room_type",
              "value": "={{ $('Parse Price Data').item.json.roomType }}"
            },
            {
              "name": "price",
              "value": "={{ $('Parse Price Data').item.json.currentPrice }}"
            },
            {
              "name": "currency",
              "value": "={{ $('Parse Price Data').item.json.currency }}"
            },
            {
              "name": "availability",
              "value": "={{ $('Parse Price Data').item.json.availability }}"
            },
            {
              "name": "timestamp",
              "value": "={{ $('Parse Price Data').item.json.checkTimestamp }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f52dff1c-b64f-4e04-9273-ed3b26074e37",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        320
      ],
      "parameters": {
        "color": 5,
        "width": 220,
        "height": 140,
        "content": "## 💾 数据库更新"
      },
      "typeVersion": 1
    },
    {
      "id": "33fccfde-7e4a-464c-b056-97ef34d8e7ec",
      "name": "创建执行摘要",
      "type": "n8n-nodes-base.code",
      "notes": "Generates summary report of price check execution and alerts sent",
      "position": [
        96,
        64
      ],
      "parameters": {
        "jsCode": "// Generate execution summary\nconst allLogs = $input.all();\n\nconst totalHotels = allLogs.length;\nconst alertsSent = allLogs.filter(item => item.json.alertSent === true).length;\nconst noAlerts = allLogs.filter(item => item.json.alertSent === false).length;\n\nconst summary = {\n  executionTimestamp: new Date().toISOString(),\n  executionDate: new Date().toLocaleDateString('en-US', { \n    year: 'numeric', \n    month: 'long', \n    day: 'numeric',\n    hour: '2-digit',\n    minute: '2-digit'\n  }),\n  totalHotelsChecked: totalHotels,\n  priceDropAlertsRaised: alertsSent,\n  noAlertsNeeded: noAlerts,\n  alertRate: totalHotels > 0 ? ((alertsSent / totalHotels) * 100).toFixed(1) + '%' : '0%',\n  status: 'completed',\n  nextCheckIn: '6 hours'\n};\n\nreturn {\n  json: summary\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "552c8be1-cda3-4a06-834d-735f11e88fbf",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -112
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 284,
        "content": "## 📊 摘要报告"
      },
      "typeVersion": 1
    },
    {
      "id": "f141855d-90f2-47bc-9839-c5953f12863c",
      "name": "便签14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -1216
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 792,
        "content": "## 🏨 酒店房间价格检查器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c121be3a-bd75-426b-9e52-9f1859cb47c6",
  "connections": {
    "Compare Prices": {
      "main": [
        [
          {
            "node": "Check if Price Reduced",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Alert Sent": {
      "main": [
        [
          {
            "node": "Merge All Logs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Logs": {
      "main": [
        [
          {
            "node": "Update Price in Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Hotel List": {
      "main": [
        [
          {
            "node": "Fetch Current Price from API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Price Data": {
      "main": [
        [
          {
            "node": "Get Previous Price from DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Alert Email": {
      "main": [
        [
          {
            "node": "Send Email to Travel Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log No Alert Needed": {
      "main": [
        [
          {
            "node": "Merge All Logs",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check if Price Reduced": {
      "main": [
        [
          {
            "node": "Format Alert Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log No Alert Needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule - Every 6 Hours": {
      "main": [
        [
          {
            "node": "Load Hotel List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Price in Database": {
      "main": [
        [
          {
            "node": "Create Execution Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Previous Price from DB": {
      "main": [
        [
          {
            "node": "Compare Prices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email to Travel Agent": {
      "main": [
        [
          {
            "node": "Log Alert Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Current Price from API": {
      "main": [
        [
          {
            "node": "Parse Price Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研

需要付费吗?

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

工作流信息
难度等级
高级
节点数量29
分类1
节点类型7
难度说明

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

作者
Oneclick AI Squad

Oneclick AI Squad

@oneclick-ai

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.

外部链接
在 n8n.io 查看

分享此工作流