{
  "id": "gLWjskyU2lMuvt4Z",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Real-Time AI Engine for Monitoring Japan Flight Prices and Booking Signals",
  "tags": [],
  "nodes": [
    {
      "id": "6852ea42-9190-456a-91ba-31017cdbb869",
      "name": "Schedule Price Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2400,
        144
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7a09668f-3b66-42ad-a865-05e3de17e439",
      "name": "Flight Search Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -2176,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "departure_city",
              "name": "departure_city",
              "type": "string",
              "value": "New York"
            },
            {
              "id": "destination",
              "name": "destination",
              "type": "string",
              "value": "Tokyo"
            },
            {
              "id": "date_range_start",
              "name": "date_range_start",
              "type": "string",
              "value": "={{ $now.plus(30, 'days').toFormat('yyyy-MM-dd') }}"
            },
            {
              "id": "date_range_end",
              "name": "date_range_end",
              "type": "string",
              "value": "={{ $now.plus(60, 'days').toFormat('yyyy-MM-dd') }}"
            },
            {
              "id": "max_budget",
              "name": "max_budget",
              "type": "number",
              "value": 1200
            },
            {
              "id": "preferred_departure_time",
              "name": "preferred_departure_time",
              "type": "string",
              "value": "morning"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "be067da4-69f9-44f8-88ba-695ca8f4ff4f",
      "name": "Check Kayak API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1952,
        -48
      ],
      "parameters": {
        "url": "https://www.kayak.com/flights/{{ $json.departure_city }}-{{ $json.destination }}/{{ $json.date_range_start }}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "68eb13dc-452d-492e-85b5-b0bcd07eb32b",
      "name": "Check Google Flights",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1952,
        144
      ],
      "parameters": {
        "url": "https://www.google.com/travel/flights/search?q=Flights+to+{{ $json.destination }}+from+{{ $json.departure_city }}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8b8bef45-8f89-4b66-bb63-e553e32c3507",
      "name": "Check Skyscanner",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1952,
        336
      ],
      "parameters": {
        "url": "https://www.skyscanner.com/transport/flights/{{ $json.departure_city }}/{{ $json.destination }}",
        "options": {
          "response": {
            "response": {
              "fullResponse": true
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "db529cb3-750e-4f3b-98e2-02853c983380",
      "name": "Aggregate Flight Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1728,
        144
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "c7e0751a-d3c9-4bec-a9e2-a4f9bdee677a",
      "name": "AI Analysis Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1056,
        624
      ],
      "parameters": {
        "options": {
          "temperature": 0.3
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9265c117-2360-493e-ad7b-5c3347470206",
      "name": "Flight Price Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1056,
        416
      ],
      "parameters": {
        "text": "=You are a flight price analysis expert. Analyze the following flight data for trips to Japan:\n\nSearch Criteria:\n- Departure: {{ $('Flight Search Parameters').item.json.departure_city }}\n- Destination: {{ $('Flight Search Parameters').item.json.destination }}\n- Date Range: {{ $('Flight Search Parameters').item.json.date_range_start }} to {{ $('Flight Search Parameters').item.json.date_range_end }}\n- Max Budget: ${{ $('Flight Search Parameters').item.json.max_budget }}\n- Preferred Time: {{ $('Flight Search Parameters').item.json.preferred_departure_time }}\n\nFlight Data from Multiple Sources:\n{{ JSON.stringify($json) }}\n\nAnalyze and provide:\n1. Extract all flight prices, dates, and departure times from the HTML/data\n2. Identify the lowest current price and best value options\n3. Detect price trends (increasing/decreasing/stable)\n4. Calculate if we're in an optimal booking window (typically 6-8 weeks before departure)\n5. Recommend whether to book now or wait\n6. If booking is recommended, provide the specific flight details (price, date, time, airline, booking_URL)\n\nReturn results in JSON format with fields: lowest_price, best_flight_details, price_trend, optimal_window, recommendation, booking_ready, all_options_found",
        "options": {
          "systemMessage": "You are a flight booking optimization AI. Extract data from HTML responses, analyze pricing patterns, and make data-driven booking recommendations."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "450b5694-b64f-478c-8e15-543af4ab5d0a",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -896,
        592
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "18dd4132-baf4-4072-bce8-fc86ae39bce1",
      "name": "Store Price History",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -672,
        416
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "timestamp",
              "type": "string",
              "required": false,
              "displayName": "timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "lowest_price",
              "type": "number",
              "required": false,
              "displayName": "lowest_price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "price_trend",
              "type": "string",
              "required": false,
              "displayName": "price_trend",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recommendation",
              "type": "string",
              "required": false,
              "displayName": "recommendation",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Flight Price History"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "your-sheet-id"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "f1ce8a94-89e9-470d-a505-6e8c0b5ea1fc",
      "name": "Check If Booking Ready",
      "type": "n8n-nodes-base.if",
      "position": [
        -608,
        608
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "booking_ready_check",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.booking_ready }}",
              "rightValue": true
            },
            {
              "id": "price_check",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.lowest_price }}",
              "rightValue": "={{ $('Flight Search Parameters').item.json.max_budget }}"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "bf2343e6-e211-47b3-8af5-509b4628f9c0",
      "name": "Prepare Booking Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -48,
        -64
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "booking_url",
              "name": "booking_url",
              "type": "string",
              "value": "={{ $json.best_flight_details.booking_url }}"
            },
            {
              "id": "flight_price",
              "name": "flight_price",
              "type": "number",
              "value": "={{ $json.best_flight_details.price }}"
            },
            {
              "id": "flight_date",
              "name": "flight_date",
              "type": "string",
              "value": "={{ $json.best_flight_details.date }}"
            },
            {
              "id": "airline",
              "name": "airline",
              "type": "string",
              "value": "={{ $json.best_flight_details.airline }}"
            },
            {
              "id": "departure_time",
              "name": "departure_time",
              "type": "string",
              "value": "={{ $json.best_flight_details.departure_time }}"
            },
            {
              "id": "timestamp",
              "name": "timestamp",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5ccc162a-b121-430c-abba-0431838aba68",
      "name": "Send Booking Alert to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        208,
        -48
      ],
      "parameters": {
        "text": "=\ud83c\udf8c *BOOKING ALERT: Japan Flight Deal Found!*\n\n\u2708\ufe0f *Flight Details:*\n\u2022 Airline: {{ $json.airline }}\n\u2022 Price: ${{ $json.flight_price }}\n\u2022 Date: {{ $json.flight_date }}\n\u2022 Departure Time: {{ $json.departure_time }}\n\n\ud83d\udcca *Analysis:*\n\u2022 Price Trend: {{ $('Flight Price Analyzer').item.json.price_trend }}\n\u2022 Recommendation: {{ $('Flight Price Analyzer').item.json.recommendation }}\n\n\ud83d\udd17 *Book Now:* {{ $json.booking_url }}\n\n\u23f0 Alert triggered at: {{ $json.timestamp }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "3f29cab1-a8d9-4de3-a9d4-da4863221bca",
      "name": "Create WordPress Post",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        208,
        144
      ],
      "parameters": {
        "title": "=Japan Flight Deal Alert: ${{ $json.flight_price }} to {{ $('Flight Search Parameters').item.json.destination }}",
        "additionalFields": {
          "categories": [
            "Flight Deals",
            "Japan Travel"
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c46dabfd-a042-4db5-88d7-7af5947fc0ae",
      "name": "Send Price Update Summary",
      "type": "n8n-nodes-base.slack",
      "position": [
        -512,
        416
      ],
      "parameters": {
        "text": "=\ud83d\udcca *Japan Flight Price Update*\n\n\ud83d\udcb0 Current Lowest Price: ${{ $json.lowest_price }}\n\ud83d\udcc8 Trend: {{ $json.price_trend }}\n\ud83c\udfaf Optimal Window: {{ $json.optimal_window ? 'Yes \u2705' : 'No \u23f3' }}\n\n\ud83d\udca1 *Recommendation:* {{ $json.recommendation }}\n\n\ud83d\udd0d Monitoring continues every 6 hours...",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "91dde70a-d051-498b-a4cd-3558a7845260",
      "name": "Price Change Calculator",
      "type": "n8n-nodes-base.code",
      "position": [
        -1264,
        96
      ],
      "parameters": {
        "jsCode": "const currentPrice = $input.first().json.lowest_price;\nconst historicalData = $input.all();\n\nif (historicalData.length < 2) {\n  return [{\n    json: {\n      price_change_percent: 0,\n      price_volatility: 'insufficient_data',\n      trend_strength: 0,\n      prediction_confidence: 'low'\n    }\n  }];\n}\n\nconst prices = historicalData.map(item => item.json.lowest_price).filter(p => p);\nconst avgPrice = prices.reduce((a, b) => a + b, 0) / prices.length;\nconst lastPrice = prices[prices.length - 2] || currentPrice;\nconst priceChange = ((currentPrice - lastPrice) / lastPrice) * 100;\n\nconst variance = prices.reduce((sum, p) => sum + Math.pow(p - avgPrice, 2), 0) / prices.length;\nconst volatility = Math.sqrt(variance);\n\nlet volatilityLevel = 'low';\nif (volatility > avgPrice * 0.15) volatilityLevel = 'high';\nelse if (volatility > avgPrice * 0.08) volatilityLevel = 'medium';\n\nconst trendStrength = Math.abs(priceChange);\nlet confidence = 'low';\nif (historicalData.length > 10 && volatility < avgPrice * 0.1) confidence = 'high';\nelse if (historicalData.length > 5) confidence = 'medium';\n\nreturn [{\n  json: {\n    current_price: currentPrice,\n    average_price: Math.round(avgPrice),\n    price_change_percent: Math.round(priceChange * 100) / 100,\n    price_volatility: volatilityLevel,\n    volatility_value: Math.round(volatility),\n    trend_strength: Math.round(trendStrength * 100) / 100,\n    prediction_confidence: confidence,\n    data_points: historicalData.length,\n    ...($input.first().json)\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "66c6d0b4-9c8f-4c01-9320-d6a598ccc15d",
      "name": "Fetch Historical Prices",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1488,
        96
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": []
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Flight Price History"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "your-sheet-id"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "12b232ee-03fb-4852-a6dc-b685d838ca02",
      "name": "Multi-Criteria Decision",
      "type": "n8n-nodes-base.switch",
      "position": [
        -688,
        -32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "immediate_booking",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "boolean",
                      "operation": "true"
                    },
                    "leftValue": "={{ $json.booking_ready }}",
                    "rightValue": true
                  },
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.price_volatility }}",
                    "rightValue": "low"
                  },
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.prediction_confidence }}",
                    "rightValue": "high"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "price_drop_alert",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "number",
                      "operation": "lt"
                    },
                    "leftValue": "={{ $json.price_change_percent }}",
                    "rightValue": -5
                  },
                  {
                    "operator": {
                      "type": "number",
                      "operation": "gt"
                    },
                    "leftValue": "={{ $json.trend_strength }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "wait_and_monitor",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.price_volatility }}",
                    "rightValue": "high"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "2692ccdf-107c-41e8-9c63-e4a565e60107",
      "name": "Enhanced Analysis Prompt",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1040,
        208
      ],
      "parameters": {
        "model": "gpt-4o",
        "options": {
          "maxTokens": 2000,
          "temperature": 0.2
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b433af86-db71-4dce-8c9d-9f7a42fa0bea",
      "name": "Advanced Flight Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1040,
        -16
      ],
      "parameters": {
        "text": "=You are an advanced flight booking AI with predictive analytics capabilities.\n\nSearch Criteria:\n- Departure: {{ $('Flight Search Parameters').item.json.departure_city }}\n- Destination: {{ $('Flight Search Parameters').item.json.destination }}\n- Date Range: {{ $('Flight Search Parameters').item.json.date_range_start }} to {{ $('Flight Search Parameters').item.json.date_range_end }}\n- Max Budget: ${{ $('Flight Search Parameters').item.json.max_budget }}\n- Preferred Time: {{ $('Flight Search Parameters').item.json.preferred_departure_time }}\n\nCurrent Flight Data:\n{{ JSON.stringify($json) }}\n\nHistorical Analytics:\n{{ $('Price Change Calculator').first() ? JSON.stringify($('Price Change Calculator').first().json) : 'No historical data yet' }}\n\nPerform DEEP ANALYSIS:\n1. Extract ALL flight prices, dates, times, airlines, booking URLs from HTML/JSON\n2. Compare against historical average: {{ $('Price Change Calculator').first()?.json.average_price || 'N/A' }}\n3. Analyze price volatility level: {{ $('Price Change Calculator').first()?.json.price_volatility || 'unknown' }}\n4. Calculate booking urgency score (0-100) based on:\n   - Current price vs historical average\n   - Price trend direction and strength\n   - Days until departure (optimal: 45-60 days)\n   - Volatility patterns\n   - Day of week pricing patterns\n5. Identify secondary flight options (top 3 alternatives)\n6. Predict price movement for next 48 hours\n7. Generate actionable recommendation with reasoning\n\nReturn JSON with: lowest_price, best_flight_details (with booking_url, airline, price, date, departure_time), price_trend, optimal_window, booking_urgency_score, recommendation, booking_ready, alternative_flights (array of top 3), price_prediction_48h, reasoning",
        "options": {
          "systemMessage": "You are a senior flight pricing analyst with 15+ years experience. Use statistical analysis, market patterns, and airline pricing psychology to make data-driven predictions. Always provide specific reasoning for your recommendations."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "299a2b0e-5c0c-4b3b-aee0-da2efff8993d",
      "name": "Risk Assessment Check",
      "type": "n8n-nodes-base.if",
      "position": [
        -384,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.booking_urgency_score }}",
              "rightValue": 75
            },
            {
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.price_volatility }}",
              "rightValue": "high"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2a283c81-5f79-4a83-a026-a40fb02e21d7",
      "name": "Send Detailed Analytics Report",
      "type": "n8n-nodes-base.slack",
      "position": [
        -64,
        416
      ],
      "parameters": {
        "select": "channel",
        "blocksUi": {
          "blocksValues": [
            {
              "block": "={\n  \"type\": \"header\",\n  \"text\": {\n    \"type\": \"plain_text\",\n    \"text\": \"\ud83d\udcca Advanced Flight Analytics Report\"\n  }\n},\n{\n  \"type\": \"section\",\n  \"fields\": [\n    {\"type\": \"mrkdwn\", \"text\": \"*Current Price:*\\n${{ $('Advanced Flight Analyzer').item.json.lowest_price }}\"},\n    {\"type\": \"mrkdwn\", \"text\": \"*Avg Historical:*\\n${{ $('Price Change Calculator').item.json.average_price }}\"},\n    {\"type\": \"mrkdwn\", \"text\": \"*Price Change:*\\n{{ $('Price Change Calculator').item.json.price_change_percent }}%\"},\n    {\"type\": \"mrkdwn\", \"text\": \"*Volatility:*\\n{{ $('Price Change Calculator').item.json.price_volatility.toUpperCase() }}\"},\n    {\"type\": \"mrkdwn\", \"text\": \"*Urgency Score:*\\n{{ $('Advanced Flight Analyzer').item.json.booking_urgency_score }}/100\"},\n    {\"type\": \"mrkdwn\", \"text\": \"*Confidence:*\\n{{ $('Price Change Calculator').item.json.prediction_confidence.toUpperCase() }}\"}\n  ]\n},\n{\n  \"type\": \"section\",\n  \"text\": {\n    \"type\": \"mrkdwn\",\n    \"text\": \"*\ud83c\udfaf Recommendation:*\\n{{ $('Advanced Flight Analyzer').item.json.recommendation }}\"\n  }\n},\n{\n  \"type\": \"section\",\n  \"text\": {\n    \"type\": \"mrkdwn\",\n    \"text\": \"*\ud83d\udca1 Reasoning:*\\n{{ $('Advanced Flight Analyzer').item.json.reasoning }}\"\n  }\n},\n{\n  \"type\": \"section\",\n  \"text\": {\n    \"type\": \"mrkdwn\",\n    \"text\": \"*\ud83d\udd2e 48h Prediction:*\\n{{ $('Advanced Flight Analyzer').item.json.price_prediction_48h }}\"\n  }\n}"
            }
          ]
        },
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "30a5793a-8b86-4cb3-80f9-59e9db4efae8",
      "name": "Create Detailed WordPress Report",
      "type": "n8n-nodes-base.wordpress",
      "position": [
        160,
        416
      ],
      "parameters": {
        "title": "=Japan Flight Intelligence Report: {{ $now.toFormat('MMM dd, yyyy') }}",
        "additionalFields": {
          "status": "publish",
          "categories": [
            "Flight Analytics",
            "Japan Travel",
            "AI Insights"
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "559155cb-bfa5-48d2-a56f-699f284804a1",
      "name": "High Urgency Booking Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -48,
        176
      ],
      "parameters": {
        "text": "=\ud83d\udea8 *HIGH URGENCY BOOKING ALERT* \ud83d\udea8\n\n\u26a1 *Booking Urgency: {{ $('Advanced Flight Analyzer').item.json.booking_urgency_score }}/100*\n\n\u2708\ufe0f *Premium Flight Deal:*\n\u2022 Airline: {{ $('Advanced Flight Analyzer').item.json.best_flight_details.airline }}\n\u2022 Price: ${{ $('Advanced Flight Analyzer').item.json.best_flight_details.price }}\n\u2022 Date: {{ $('Advanced Flight Analyzer').item.json.best_flight_details.date }}\n\u2022 Time: {{ $('Advanced Flight Analyzer').item.json.best_flight_details.departure_time }}\n\n\ud83d\udcca *Market Intelligence:*\n\u2022 Price vs Average: {{ $('Price Change Calculator').item.json.price_change_percent }}%\n\u2022 Volatility: {{ $('Price Change Calculator').item.json.price_volatility.toUpperCase() }}\n\u2022 Confidence: {{ $('Price Change Calculator').item.json.prediction_confidence.toUpperCase() }}\n\u2022 Data Points Analyzed: {{ $('Price Change Calculator').item.json.data_points }}\n\n\ud83d\udca1 *AI Reasoning:*\n{{ $('Advanced Flight Analyzer').item.json.reasoning }}\n\n\ud83d\udd17 *BOOK IMMEDIATELY:* {{ $('Advanced Flight Analyzer').item.json.best_flight_details.booking_url }}\n\n\u23f0 Alert triggered: {{ $now.toISO() }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "C12345678"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "6675a09d-074d-4c4c-9a02-f21c67cc4774",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2576,
        -480
      ],
      "parameters": {
        "width": 656,
        "height": 240,
        "content": "## How It Works\nScheduled triggers run automated price checks across multiple travel data sources. The collected data is aggregated, validated, and processed through an AI analysis layer that compares trends, detects anomalies, and evaluates multi-criteria factors such as price movement, seasonality, and route demand. The system then routes results into booking preparation, report generation, and notification modules. When target price conditions are met, alerts are sent and records are updated accordingly.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e07f4664-1d3e-4b85-b4e3-a9872269a24d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1296,
        -480
      ],
      "parameters": {
        "color": 3,
        "width": 496,
        "height": 144,
        "content": "## Prerequisites\nGoogle Flights API, Skyscanner API, flight booking service credentials, OpenAI API key, Google Sheets access, WordPress admin account, email service configured.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4ef35334-48c7-4f5e-8ae5-185342c1def5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        -480
      ],
      "parameters": {
        "width": 560,
        "height": 224,
        "content": "## Setup Steps\n1. Connect Google Flights and Skyscanner APIs using authenticated tokens.\n2. Configure the OpenAI API for enhanced analysis and multi-factor evaluation.\n3. Link Google Sheets for storing historical price data.\n4. Add WordPress site credentials to enable automated report publishing.\n5. Enable email notifications for price alerts and updates.\n6. Adjust the scheduler frequency within the **Schedule Price Check** node to control how often the workflow runs."
      },
      "typeVersion": 1
    },
    {
      "id": "67897838-9cff-4b02-9a3c-6f1896206b99",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -480
      ],
      "parameters": {
        "color": 4,
        "width": 688,
        "height": 208,
        "content": "\n## Use Cases\nTravel agencies automating client alerts for price drops. Corporate travel managers monitoring bulk bookings.  \n\n## Customization\nModify price thresholds in Multi-Criteria Decision node. Add airline or destination filters in search parameters. \n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "24fdda51-bf90-4404-a17e-5dc4d6a4f2f3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -480
      ],
      "parameters": {
        "color": 6,
        "width": 288,
        "content": "## Benefits\nEliminates manual price monitoring. Reduces booking delays through automation. "
      },
      "typeVersion": 1
    },
    {
      "id": "f9527f77-7c61-49c9-9fbf-1ba7065044c3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2592,
        -176
      ],
      "parameters": {
        "color": 7,
        "width": 992,
        "height": 672,
        "content": "## 1. Data Collection Phase\nInitiates daily automated checks. Schedule node triggers workflows consistently. Flight Search Parameters configure search criteria (routes, dates, airlines). Fetch Historical Prices retrieves past trends\n\nWhy: Historical context prevents false positives; real-time data ensures current accuracy."
      },
      "typeVersion": 1
    },
    {
      "id": "5001ce96-bbeb-4a83-b1ec-f1a207a425dd",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 800,
        "height": 928,
        "content": "## 2. Intelligence & Analysis Phase\nPrice Change Calculator identifies trends\u2014whether prices rising or falling matters for timing. Advanced Flight Analysis enriches data with route patterns. Enhanced Analysis (AI-powered) contextualizes findings \n\nWhy: intelligent processing reveals actionable opportunities and prevents poor booking decisions."
      },
      "typeVersion": 1
    },
    {
      "id": "b403658d-e97e-4b67-a869-73fef6905585",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 464,
        "content": "## 3. Decision & Risk Management\nMulti-Criteria Decision filters by user preferences (budget, timing, airlines). Risk Assessment checks booking feasibility \n\nWhy: Prevents booking unsuitable options; ensures only qualified opportunities reach booking stage."
      },
      "typeVersion": 1
    },
    {
      "id": "325f615f-501c-40c3-a6ba-843112ca78f7",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 528,
        "content": "## 4. Storage & Notification\nGoogle Sheets archives price history, enables trend analysis and historical comparison.  \nWhy: Persistent records build intelligence; alerts enable swift action on time-sensitive deals."
      },
      "typeVersion": 1
    },
    {
      "id": "8f88cdb7-b6bb-4930-b387-da2ec3aed1f8",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 1008,
        "content": "\n## 5. Reporting & Integration\nWordPress publishes analytics reports, builds credibility and transparency. Booking data flows to external reservation systems for instant ticketing. \nWhy: Reporting demonstrates value; seamless integration converts analysis into revenue."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8921d7f6-db68-44e6-a388-ebaeb8321159",
  "connections": {
    "Check Kayak API": {
      "main": [
        [
          {
            "node": "Aggregate Flight Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Skyscanner": {
      "main": [
        [
          {
            "node": "Aggregate Flight Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Analysis Model": {
      "ai_languageModel": [
        [
          {
            "node": "Flight Price Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store Price History": {
      "main": [
        [
          {
            "node": "Send Price Update Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Google Flights": {
      "main": [
        [
          {
            "node": "Aggregate Flight Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Booking Data": {
      "main": [
        [
          {
            "node": "Send Booking Alert to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create WordPress Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Price Check": {
      "main": [
        [
          {
            "node": "Flight Search Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Flight Data": {
      "main": [
        [
          {
            "node": "Flight Price Analyzer",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Historical Prices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flight Price Analyzer": {
      "main": [
        [
          {
            "node": "Store Price History",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check If Booking Ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Risk Assessment Check": {
      "main": [
        [
          {
            "node": "Prepare Booking Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "High Urgency Booking Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Booking Ready": {
      "main": [
        [
          {
            "node": "Prepare Booking Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Historical Prices": {
      "main": [
        [
          {
            "node": "Price Change Calculator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Multi-Criteria Decision": {
      "main": [
        [
          {
            "node": "Risk Assessment Check",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Detailed Analytics Report",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Price Update Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Price Change Calculator": {
      "main": [
        [
          {
            "node": "Advanced Flight Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Advanced Flight Analyzer": {
      "main": [
        [
          {
            "node": "Multi-Criteria Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enhanced Analysis Prompt": {
      "ai_languageModel": [
        [
          {
            "node": "Advanced Flight Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Flight Search Parameters": {
      "main": [
        [
          {
            "node": "Check Kayak API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Google Flights",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Skyscanner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Flight Price Analyzer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Send Detailed Analytics Report": {
      "main": [
        [
          {
            "node": "Create Detailed WordPress Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}