{
  "name": "Monitor hotel competitor rates and answer WhatsApp Q&A using OpenAI GPT-4.1",
  "nodes": [
    {
      "id": "148c7c8b-2c56-4a85-8c9a-43e0938eea6c",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        -112
      ]
    },
    {
      "id": "af6fd0df-1be7-4fca-a576-e1f3cda511e9",
      "name": "Generate 30 night windows",
      "type": "n8n-nodes-base.code",
      "position": [
        528,
        -112
      ]
    },
    {
      "id": "ae083efe-c987-41a2-8004-bfea3caabf5d",
      "name": "Amadeus OAuth",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -112
      ]
    },
    {
      "id": "75c62008-dc34-4193-9559-abc4b327f863",
      "name": "Amadeus Hotel Offers",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        704,
        -48
      ]
    },
    {
      "id": "13fd9cc9-d9e5-4613-9014-a621268901dd",
      "name": "Prev Snapshot",
      "type": "n8n-nodes-base.code",
      "position": [
        1824,
        -48
      ]
    },
    {
      "id": "f8f52b3a-d4e0-4a71-96df-cddb41cc41b6",
      "name": "New Snapshot",
      "type": "n8n-nodes-base.code",
      "position": [
        1488,
        -96
      ]
    },
    {
      "id": "5f6d09f7-4d6f-4459-95f1-0307d827859e",
      "name": "Compute Change",
      "type": "n8n-nodes-base.code",
      "position": [
        -224,
        384
      ]
    },
    {
      "id": "778472bb-1e24-45ed-8282-025132d50f4e",
      "name": "Significant Competitor Change",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        384
      ]
    },
    {
      "id": "a35561a3-f6e5-465e-9a75-85f68a9ada22",
      "name": "Get Our Hotel Rates",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        192,
        464
      ]
    },
    {
      "id": "c618b644-7349-4c28-917a-8ac06ae91fee",
      "name": "Prefix Our Hotel Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        464
      ]
    },
    {
      "id": "c26bbbf2-4096-4399-b9d2-206b917f5fe5",
      "name": "Build VCC URLs",
      "type": "n8n-nodes-base.code",
      "position": [
        816,
        480
      ]
    },
    {
      "id": "c33c9db9-5763-4ef7-a4fb-98e634618ac8",
      "name": "Fetch VCC Month HTML",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        992,
        480
      ]
    },
    {
      "id": "5e2b3b9c-3065-4708-9e6c-d126cdc737d9",
      "name": "Events Extract",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        480
      ]
    },
    {
      "id": "77115dfc-75c9-4966-ae34-b1ec6234a014",
      "name": "Combine 30-Day Rates",
      "type": "n8n-nodes-base.merge",
      "position": [
        912,
        -96
      ]
    },
    {
      "id": "5f436d25-091c-4b4e-9eb7-15f90f402a64",
      "name": "Get Prev Rates",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1664,
        -48
      ]
    },
    {
      "id": "92e54bf4-dd04-4813-a83c-bd4db6e868ca",
      "name": "Upsert Latest Rates",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2256,
        -224
      ]
    },
    {
      "id": "556269b7-e938-419e-9984-843abe76a9f8",
      "name": "Insert History Rates",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2256,
        -80
      ]
    },
    {
      "id": "d97aba48-4dd9-407c-84d0-97341d4dfbcf",
      "name": "Combine New Rates vs Prev Rates",
      "type": "n8n-nodes-base.merge",
      "position": [
        2016,
        -80
      ]
    },
    {
      "id": "9284f26f-e218-4418-8898-82bebcd5f004",
      "name": "Combine Competitor Rates vs Our Rates",
      "type": "n8n-nodes-base.merge",
      "position": [
        544,
        384
      ]
    },
    {
      "id": "c7f2f0e4-e767-40ef-8d69-a3296b44ae8a",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2128,
        592
      ]
    },
    {
      "id": "3e29025d-940a-46db-bc92-6f10b688ba75",
      "name": "Normalize Whatsapp Input",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        880
      ]
    },
    {
      "id": "d99ca3f4-3c38-4240-8cb5-19c582b84df2",
      "name": "Prepare AI Agent Input",
      "type": "n8n-nodes-base.code",
      "position": [
        1824,
        400
      ]
    },
    {
      "id": "1c659f17-e275-47e4-a8fa-888ba3f4e9d1",
      "name": "Get Hotel_Rates_History",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1584,
        1072
      ]
    },
    {
      "id": "3c88e845-7589-4b8c-bf66-a0b271098d20",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        544,
        896
      ]
    },
    {
      "id": "8d395a5f-7f59-4e91-892b-041bf8af8223",
      "name": "Upsert Hotel Price Alerts",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2496,
        576
      ]
    },
    {
      "id": "263bd8c2-7db7-4ada-a955-994aa9e89c0c",
      "name": "Get Alert Summary",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1168,
        880
      ]
    },
    {
      "id": "7c3561e8-f3bc-4d8b-a610-258c033717a7",
      "name": "Q&A",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1712,
        880
      ]
    },
    {
      "id": "7148c03e-8074-4ffb-b44c-57b9bad6a9c0",
      "name": "AI Agent: Q&A",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1360,
        880
      ]
    },
    {
      "id": "cdd7cedb-b58c-429e-a7b4-f4e4e910c12a",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1264,
        1088
      ]
    },
    {
      "id": "5b413733-d683-4f16-8479-a93c6167c29c",
      "name": "Combine Rates & Events",
      "type": "n8n-nodes-base.merge",
      "position": [
        1520,
        400
      ]
    },
    {
      "id": "43e07862-01f2-4c98-8c75-d366c8c97094",
      "name": "Combine Summary & Alert",
      "type": "n8n-nodes-base.merge",
      "position": [
        2304,
        576
      ]
    },
    {
      "id": "0328da70-92cb-4864-b958-99a0a5c52f40",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -1088
      ],
      "parameters": {
        "width": 1712,
        "height": 768,
        "content": "## How It Works \n***Top Branch Workflow***\n\n**1. Intraday Monitoring:** Runs on schedule to catch competitor hotel's price shifts throughout the day. It fetches rates for the next 30 days via Amadeus "
      }
    },
    {
      "id": "b18a26fa-7335-44a7-a39f-0a3018f184aa",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        -544
      ],
      "parameters": {
        "width": 496,
        "height": 176,
        "content": "## Prerequisites\n- OTA Platform API Key (e.g. Amadeus, Expedia)\n- LLM AI Model API Key (e.g. OpenAI, Gemini)\n- Database (e.g. n8n cloud, PostgreSQL)\n- Message Tool API Key (e.g. WhatsApp, Gmail)"
      }
    },
    {
      "id": "fe1731dc-6b7d-426f-8630-5deede6e872f",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1424,
        1088
      ]
    },
    {
      "id": "691e46ad-822e-46e7-88e8-0eb66269d2a1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        -1024
      ],
      "parameters": {
        "width": 992,
        "height": 416,
        "content": "## Use Cases & Benefits\n**Revenue Managers:** \nAutomate the \"rate shop\" routine and catch competitor moves without opening a spreadsheet.\n\n**Sales & Marketing Teams:** \nGo beyond raw data. Pairing \"wh"
      }
    },
    {
      "id": "bf602fee-c0a4-4e73-96d9-7ea621804607",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        -288
      ],
      "parameters": {
        "width": 1440,
        "height": 480,
        "content": "## Data Consolidation & Archiving\nConsolidates the results with the previous pricing snapshot into a single dataset for further processing and archives into the data bases."
      }
    },
    {
      "id": "c8fa37bf-c5df-43ee-8cb1-e0e8061845a1",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -288
      ],
      "parameters": {
        "width": 1440,
        "height": 480,
        "content": "## Data Collection Engine\nThis section triggers on a schedule (09:00, 15:00, 21:00) to ensure intraday coverage. It generates 30 individual date windows and queries the Amadeus API to fetch live prici"
      }
    },
    {
      "id": "4f7fc126-6624-4b3e-a0be-5369495bb0c2",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        256
      ],
      "parameters": {
        "width": 1008,
        "height": 480,
        "content": "## Change Detection & Comparison\nFilters for competitor's significant price changes (>10%) and fetch our hotel's prices for further analysis."
      }
    },
    {
      "id": "80c6449d-728b-4d38-860b-1f242d0c337c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        256
      ],
      "parameters": {
        "width": 928,
        "height": 480,
        "content": "## Market Context\nScrapes the Vancouver Convention Centre (VCC) website for the specific alert dates to identify if a conference or event is driving the competitor's price surge."
      }
    },
    {
      "id": "0f63fdd0-10ee-429e-a990-6ac9f6733ca1",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        256
      ],
      "parameters": {
        "width": 960,
        "height": 480,
        "content": "## Analysis by Revenue AI Agent\nConducts analysis to generate a strategic \"Executive Summary\" recommending specific revenue actions. Delivers the result and archives into the data base."
      }
    },
    {
      "id": "dd8d2e47-140d-463b-aceb-81e275d38331",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        768
      ],
      "parameters": {
        "width": 1440,
        "height": 480,
        "content": "## Follow-Up Q&A with Revenue AI Agent\nRetrieves the latest alert context and uses database tools to answer our follow-up questions with historical trend data."
      }
    },
    {
      "id": "46e9f99c-22fb-4f5c-8810-435d8e3b3c96",
      "name": "AI Agent: Analyze",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2064,
        400
      ]
    },
    {
      "id": "0bf6f56b-ebb6-4851-ae7b-e11046d3c005",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1920,
        608
      ]
    },
    {
      "id": "a391a7ef-8129-48bb-84d7-44cdd48112d5",
      "name": "Daily Market Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        96,
        -112
      ]
    },
    {
      "id": "4e185c90-5a0a-4c1d-989b-6309cf263111",
      "name": "Extract Event Details",
      "type": "n8n-nodes-base.html",
      "position": [
        1184,
        480
      ]
    },
    {
      "id": "d8fc6f9e-ac02-44d8-9bac-d0554fe62925",
      "name": "Clean Amadeus Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1312,
        -96
      ]
    },
    {
      "id": "9214aa2f-f21a-4f9c-b5df-c00591d772e2",
      "name": "Send WhatsApp Alert",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2496,
        400
      ]
    },
    {
      "id": "579fe539-4359-44b7-9cd9-c4aa7b14ee40",
      "name": "Filter Text Messages",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        896
      ]
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Amadeus OAuth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Snapshot": {
      "main": [
        [
          {
            "node": "Combine New Rates vs Prev Rates",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Prev Rates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Q&A": {
      "main": [
        [
          {
            "node": "Q&A",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Amadeus OAuth": {
      "main": [
        [
          {
            "node": "Generate 30 night windows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prev Snapshot": {
      "main": [
        [
          {
            "node": "Combine New Rates vs Prev Rates",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent: Q&A",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Build VCC URLs": {
      "main": [
        [
          {
            "node": "Fetch VCC Month HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compute Change": {
      "main": [
        [
          {
            "node": "Significant Competitor Change",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Events Extract": {
      "main": [
        [
          {
            "node": "Combine Rates & Events",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Prev Rates": {
      "main": [
        [
          {
            "node": "Prev Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Filter Text Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Analyze": {
      "main": [
        [
          {
            "node": "Send WhatsApp Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine Summary & Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Alert Summary": {
      "main": [
        [
          {
            "node": "AI Agent: Q&A",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Analyze",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Clean Amadeus Data": {
      "main": [
        [
          {
            "node": "New Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Market Check": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Q&A",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Our Hotel Rates": {
      "main": [
        [
          {
            "node": "Prefix Our Hotel Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert Latest Rates": {
      "main": [
        []
      ]
    },
    "Amadeus Hotel Offers": {
      "main": [
        [
          {
            "node": "Combine 30-Day Rates",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Combine 30-Day Rates": {
      "main": [
        [
          {
            "node": "Clean Amadeus Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch VCC Month HTML": {
      "main": [
        [
          {
            "node": "Extract Event Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Text Messages": {
      "main": [
        [
          {
            "node": "Normalize Whatsapp Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Event Details": {
      "main": [
        [
          {
            "node": "Events Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Rates & Events": {
      "main": [
        [
          {
            "node": "Prepare AI Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare AI Agent Input": {
      "main": [
        [
          {
            "node": "AI Agent: Analyze",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine Summary & Alert",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Combine Summary & Alert": {
      "main": [
        [
          {
            "node": "Upsert Hotel Price Alerts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Hotel_Rates_History": {
      "ai_tool": [
        [
          {
            "node": "AI Agent: Q&A",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Prefix Our Hotel Fields": {
      "main": [
        [
          {
            "node": "Combine Competitor Rates vs Our Rates",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Normalize Whatsapp Input": {
      "main": [
        [
          {
            "node": "Get Alert Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent: Analyze",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate 30 night windows": {
      "main": [
        [
          {
            "node": "Combine 30-Day Rates",
            "type": "main",
            "index": 0
          },
          {
            "node": "Amadeus Hotel Offers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Significant Competitor Change": {
      "main": [
        [
          {
            "node": "Get Our Hotel Rates",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine Competitor Rates vs Our Rates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine New Rates vs Prev Rates": {
      "main": [
        [
          {
            "node": "Upsert Latest Rates",
            "type": "main",
            "index": 0
          },
          {
            "node": "Compute Change",
            "type": "main",
            "index": 0
          },
          {
            "node": "Insert History Rates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Competitor Rates vs Our Rates": {
      "main": [
        [
          {
            "node": "Build VCC URLs",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine Rates & Events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}