{
  "name": "AI-Powered Travel Booking & Smart Reminder Automation System(Tour & Travel Agency)",
  "nodes": [
    {
      "parameters": {
        "availableInChat": true,
        "agentName": "Infy Tour & Travel Assistant",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        -752,
        -1104
      ],
      "id": "f47e315c-fd79-48ba-93b1-98b9016eed44",
      "name": "When chat message received",
      "webhookId": "2c513b9d-8801-47c4-909c-898149c61b53"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "responsesApiEnabled": false,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        -816,
        -848
      ],
      "id": "028e0711-742c-47a6-abf3-9b004c7cff43",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "zHTJ5AI7kBmTnuvv",
          "name": "InfyOm"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -656,
        -848
      ],
      "id": "57592e37-c058-4a3e-8312-2d95ae03dfa6",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "=Search for travel packages by destination city name. Returns all available packages for the specified destination including package details, duration, and pricing.",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 561667531,
          "mode": "list",
          "cachedResultName": "Packages",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=561667531"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Destination",
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', `The destination city name to search for packages (e.g. Dubai)`, 'string') }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -496,
        -848
      ],
      "id": "c3739fa8-c66f-484c-90bd-27d59cb956f0",
      "name": "Get Packages Details",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Retrieve existing booking details by BookingID. Use this to look up customer booking information and show booking summary.",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Bookings",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "BookingID",
              "lookupValue": "={{ $fromAI('values0_Value', 'The BookingID to retrieve', 'string') }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -352,
        -848
      ],
      "id": "6565fb77-cfa8-4c18-bfa2-692eee832cd7",
      "name": "Get Exist Booking",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Create a new booking with customer details, package selection, and travel date. Generates a confirmed booking with pending payment status.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Bookings",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "BookingStatus": "=Confirmed",
            "BookingID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('BookingID', `Append a same as a 'Append Trip Details' tool`, 'string') }}",
            "CustomerName": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('CustomerName', ``, 'string') }}",
            "Phone": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Phone', ``, 'string') }}",
            "Package": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Package', ``, 'string') }}",
            "TravelDate": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('TravelDate', ``, 'string') }}",
            "PaymentStatus": "Pending",
            "Amount": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Amount', ``, 'string') }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "BookingID",
              "displayName": "BookingID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "CustomerName",
              "displayName": "CustomerName",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Package",
              "displayName": "Package",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "TravelDate",
              "displayName": "TravelDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "displayName": "Amount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "PaymentStatus",
              "displayName": "PaymentStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "BookingStatus",
              "displayName": "BookingStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "InvoiceLink",
              "displayName": "InvoiceLink",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PaymentID",
              "displayName": "PaymentID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -208,
        -848
      ],
      "id": "4835a19a-8f85-474f-9721-f1cfdc99f12f",
      "name": "Append Booking",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Reschedule an existing booking by updating the travel date. IMPORTANT: Before using this tool, you must first retrieve the booking using Get Exist Booking tool and verify that the current TravelDate has not passed. Only reschedule bookings with future or current travel dates. Requires BookingID to match the booking and new TravelDate.",
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Bookings",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "BookingStatus": "=Rescheduled",
            "BookingID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('BookingID__using_to_match_', ``, 'string') }}",
            "TravelDate": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('TravelDate', ``, 'string') }}"
          },
          "matchingColumns": [
            "BookingID"
          ],
          "schema": [
            {
              "id": "BookingID",
              "displayName": "BookingID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "CustomerName",
              "displayName": "CustomerName",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Package",
              "displayName": "Package",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TravelDate",
              "displayName": "TravelDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "displayName": "Amount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PaymentStatus",
              "displayName": "PaymentStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "BookingStatus",
              "displayName": "BookingStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "InvoiceLink",
              "displayName": "InvoiceLink",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "PaymentID",
              "displayName": "PaymentID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        -48,
        -848
      ],
      "id": "6dbbb44b-6c72-4968-9701-cca0a05fc287",
      "name": "Reschedule Booking",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=You are a professional AI Assistant for Infy Tour & Travel. Your role is to help customers find and book travel packages.\n\n**AGENCY INFORMATION**:\n- Agency Name: Infy Tour & Travel\n- You represent Infy Tour & Travel and assist customers with travel bookings\n\n**GREETING & CONVERSATION FLOW**:\n- Warmly greet customers and introduce yourself as Infy Tour & Travel assistant\n- FIRST STEP: Always ask the customer which city/destination they want to travel to\n- Once you have the destination, use the Get Packages Details tool to retrieve available packages\n- Present the packages to the customer with details (duration, pricing, inclusions)\n- Ask which package they prefer before proceeding with booking\n\n**CURRENT DATE & TIME CONTEXT**:\nToday is: {{ $now.format('yyyy-MM-dd') }}\nCurrent time: {{ $now.format('HH:mm:ss') }}\nDay: {{ $now.format('EEEE') }}\n\nWhen customers mention relative dates, convert them:\n- \"today\" = {{ $now.format('yyyy-MM-dd') }}\n- \"tomorrow\" = {{ $now.plus({ days: 1 }).format('yyyy-MM-dd') }}\n- Weekday names = calculate next occurrence from today\n\nAlways store dates in yyyy-MM-dd format.\n\n**BOOKING PROCESS - CRITICAL TOOL CALLING SEQUENCE**:\n1. Ask for destination city\n2. Retrieve and show available packages for that destination\n3. Let customer choose their preferred package\n4. Collect: customer name, phone number, travel date\n5. **BOOKING TIME RESTRICTION**: Before proceeding with the booking, check if the customer's travel date is today ({{ $now.format('yyyy-MM-dd') }}) and the current time is after 12:00 PM. If both conditions are true, inform the customer: \"I apologize, but same-day bookings are only available before 12:00 PM (noon). Since it's currently {{ $now.format('HH:mm:ss') }}, please choose a travel date starting from tomorrow ({{ $now.plus({ days: 1 }).format('yyyy-MM-dd') }}) or later.\" Then ask them to provide a new travel date. Do not proceed with booking until they provide a valid date.\n6. Generate unique BookingID (format: infy + random 5-digit number, e.g., infy12345)\n7. **Always TOOL CALL**: Use 'Append Booking' tool with:\n   - CustomerName\n   - Phone\n   - Package\n   - TravelDate\n   - Amount\n   - BookingID (same as step 8)\n   - BookingStatus: Confirmed\n   - PaymentStatus: Pending\n8. **Always TOOL CALL (IMMEDIATELY AFTER)**: Use 'Append Tripe Details' tool with THE SAME BookingID and:\n   - BookingID (auto-generated using this : (auto-generated using this : infy{{ Math.floor(Math.random() * 100000) }}))\n   - Name (same as CustomerName)\n   - Phone (same as step 7)\n   - DepartureDate (same as TravelDate)\n9. Confirm booking details to customer\n10. AFTER CONFIRMING THE BOOKING, always add this message:\n   \"Our team will contact you soon for help with payment and other guidelines.\"\n\n**IMPORTANT**: You MUST call both tools in sequence for every new booking. Do not skip the Append Tripe Details tool call.\n\n**CANCELLATION PROCESS**:\nWhen a customer wants to cancel a booking:\n1. Ask for their BookingID\n2. Use Get Exist Booking tool to retrieve the booking details\n3. Show ONLY these three details to the customer: Customer Name, Package, and Travel Date. DO NOT show Amount, Booking Status, Payment Status, Phone, or any other booking information.\n4. Inform them that to cancel the booking, they need to contact our support team\n5. Provide support contact information:\n   - Phone: 1234567897\n   - Email: infytour.travel@gmail.com\n6. Let them know the support team will help them with the cancellation process\n\n**RESCHEDULING PROCESS**:\nWhen a customer wants to reschedule a booking:\n1. Ask for their BookingID\n2. Use Get Exist Booking tool to retrieve the booking details\n3. Check if the TravelDate from the booking is in the past compared to today's date ({{ $now.format('yyyy-MM-dd') }})\n4. If TravelDate has already passed, inform the customer that this booking cannot be rescheduled because the travel date has already passed and suggest they contact support or make a new booking\n5. If TravelDate is today or in the future, the booking is valid for rescheduling - proceed to ask for the new travel date mssage only o not menssion a date valid message in response.\n6. Once you have the new date, use the Reschedule Booking tool with the BookingID and new TravelDate\n7. Confirm the rescheduling to the customer with updated details\n\n**OTHER SERVICES**:\n- Lookup existing bookings by BookingID\n- Reschedule bookings (update date/package)\n- Cancel bookings (provide support contact info)\n\n**Guidelines**:\n- Be friendly and conversational\n- Always ask for destination FIRST when booking\n- Show all available packages before booking\n- Collect complete information before creating bookings\n- CRITICAL: Always call Append Booking first, then immediately call Append Tripe Details with the same BookingID\n- After confirming a new booking, ALWAYS include the message about team contact for payment help\n- For cancellations, always retrieve booking first, show summary, then provide support contact\n- Provide clear confirmations after each action"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -496,
        -1104
      ],
      "id": "5fe28cb2-5dac-40a7-ba88-ff023ea83ec5",
      "name": "Tour & Travel AI Agent"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Add trip details to the Trips sheet for reminder tracking. Should be called after creating a new booking with the same BookingID, customer name, phone, and departure date.",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1716049084,
          "mode": "list",
          "cachedResultName": "Trips",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=1716049084"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "BookingID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('BookingID', ``, 'string') }}",
            "Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Name', ``, 'string') }}",
            "Phone": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Phone', ``, 'string') }}",
            "DepartureDate": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('DepartureDate', ``, 'string') }}",
            "Reminder7": "No",
            "Reminder1": "No"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "BookingID",
              "displayName": "BookingID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "DepartureDate",
              "displayName": "DepartureDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Reminder7",
              "displayName": "Reminder7",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Reminder1",
              "displayName": "Reminder1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "TicketLink",
              "displayName": "TicketLink",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "HotelVoucher",
              "displayName": "HotelVoucher",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        128,
        -848
      ],
      "id": "b3d3081b-9590-46be-9998-a3fc8c387d8b",
      "name": "Append Tripe Details",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1716049084,
          "mode": "list",
          "cachedResultName": "Trips",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=1716049084"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "DepartureDate",
              "lookupValue": "={{ $now.plus({ days: 1 }).format('yyyy-MM-dd') }}"
            },
            {
              "lookupColumn": "DepartureDate",
              "lookupValue": "={{ $now.plus({ days: 7 }).format('yyyy-MM-dd') }}"
            }
          ]
        },
        "combineFilters": "OR",
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -784,
        -560
      ],
      "id": "36b4f850-1146-41ca-a082-19d069377e76",
      "name": "Fetch Upcoming Trips (+1 & +7 Days)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            },
            {
              "triggerAtHour": 21
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -992,
        -560
      ],
      "id": "ede0c630-568c-41ad-99f6-3d55ad344001",
      "name": "Daily Reminder Cron (9AM)"
    },
    {
      "parameters": {
        "jsCode": "const today = new Date();\n\nreturn items.map(item => {\n  const departure = new Date(item.json.DepartureDate);\n  const diff = Math.ceil((departure - today) / (1000 * 60 * 60 * 24));\n\n  item.json.daysLeft = diff;\n  return item;\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -592,
        -560
      ],
      "id": "aa93b327-40be-46d0-a3b1-bf32daa1b48c",
      "name": "Calculate Days Left"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.daysLeft }}",
                    "rightValue": 7,
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "id": "16b42023-16dd-45f6-b695-4dc3ba563764"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "7 Days Left"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "42c60fd1-900e-4226-b79d-56a12e5977c7",
                    "leftValue": "={{ $json.daysLeft }}",
                    "rightValue": 1,
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "1 Days Left"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        -416,
        -560
      ],
      "id": "1233f7f4-187d-4252-b750-b418bdc44509",
      "name": "Route: 1-Day vs 7-Day Reminder"
    },
    {
      "parameters": {
        "from": "+14155238886",
        "to": "=+91{{ $json.Phone }}",
        "toWhatsapp": true,
        "message": "=Welcome to ✈️ Infy Travel & Tour\n\nHi {{ $json.Name }},\n\n🌍 Your trip is just 7 days away!\n\n🧳 Destination: {{ $json.Package || 'Your Travel Package' }}\n📅 Departure Date: {{ $json.DepartureDate }}\n\nPlease make sure:\n✔️ ID/Passport is ready  \n✔️ Packing essentials done  \n\nWe’ll share your tickets & hotel details soon.\n\n✈️ Infy Travel & Tour\nMaking your journey smooth & memorable!",
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        -112,
        -640
      ],
      "id": "7f284dbd-0fd9-4068-b9e6-9a009e9067fb",
      "name": "Send 7-Day Reminder (WhatsApp)",
      "credentials": {
        "twilioApi": {
          "id": "vTM9zbcO5mzo9dps",
          "name": "Twilio account 3"
        }
      }
    },
    {
      "parameters": {
        "from": "+14155238886",
        "to": "=+91{{ $json.Phone }}",
        "toWhatsapp": true,
        "message": "=Welcom To Again ✈️ Infy Travel & Tour\n\nHi {{ $json.Name }},\n\n⏳ Your trip starts tomorrow!\n\n📅 Departure: {{ $json.DepartureDate }}\n\n🎫 Tickets: {{ $json.TicketLink }}\n🏨 Hotel Details: {{ $json.HotelVoucher }}\n\nPlease reach on time and keep your ID handy.\n\nHave a wonderful journey! 🌴\nWe wish you a safe & happy journey ❤️",
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        -112,
        -464
      ],
      "id": "27f1d598-547b-465f-8003-77a3b8d5f656",
      "name": "Send 1-Day Reminder + Tickets",
      "credentials": {
        "twilioApi": {
          "id": "vTM9zbcO5mzo9dps",
          "name": "Twilio account 3"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1716049084,
          "mode": "list",
          "cachedResultName": "Trips",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=1716049084"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Reminder7": "Yes",
            "Phone": "={{ $('Route: 1-Day vs 7-Day Reminder').item.json.Phone }}"
          },
          "matchingColumns": [
            "Phone"
          ],
          "schema": [
            {
              "id": "BookingID",
              "displayName": "BookingID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "DepartureDate",
              "displayName": "DepartureDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Reminder7",
              "displayName": "Reminder7",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Reminder1",
              "displayName": "Reminder1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "TicketLink",
              "displayName": "TicketLink",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "HotelVoucher",
              "displayName": "HotelVoucher",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        128,
        -640
      ],
      "id": "edcface3-b04c-408a-9e56-22aa3cb36a0b",
      "name": "Mark Reminder7 Sent",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k",
          "mode": "list",
          "cachedResultName": "Travel & Tour Agency",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1716049084,
          "mode": "list",
          "cachedResultName": "Trips",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit#gid=1716049084"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Reminder1": "Yes",
            "Phone": "={{ $('Route: 1-Day vs 7-Day Reminder').item.json.Phone }}"
          },
          "matchingColumns": [
            "Phone"
          ],
          "schema": [
            {
              "id": "BookingID",
              "displayName": "BookingID",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "DepartureDate",
              "displayName": "DepartureDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Reminder7",
              "displayName": "Reminder7",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Reminder1",
              "displayName": "Reminder1",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "TicketLink",
              "displayName": "TicketLink",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "HotelVoucher",
              "displayName": "HotelVoucher",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        128,
        -464
      ],
      "id": "70238716-ef92-479b-9909-cd39f1bc474a",
      "name": "Mark Reminder1 Sent",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "WdaCQmtoNquNSoAA",
          "name": "Suresh_Google Sheets"
        }
      }
    },
    {
      "parameters": {
        "content": "## Google Sheet\nhttps://docs.google.com/spreadsheets/d/1oSHEE2Kn4uBwoEDmmrqcqPTOpQ_Z_HBaQcoEgj2ut1k/edit?usp=sharing",
        "height": 144
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1120,
        -960
      ],
      "id": "30118435-c57f-4959-86d4-0f251cb8be69",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Auto Trip Alerts",
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -992,
        -624
      ],
      "id": "2b2589f4-59ae-46e4-8d5b-e1927f4d742f",
      "name": "Sticky Note1"
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get Packages Details": {
      "ai_tool": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Exist Booking": {
      "ai_tool": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Append Booking": {
      "ai_tool": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Reschedule Booking": {
      "ai_tool": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Append Tripe Details": {
      "ai_tool": [
        [
          {
            "node": "Tour & Travel AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Upcoming Trips (+1 & +7 Days)": {
      "main": [
        [
          {
            "node": "Calculate Days Left",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Reminder Cron (9AM)": {
      "main": [
        [
          {
            "node": "Fetch Upcoming Trips (+1 & +7 Days)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Days Left": {
      "main": [
        [
          {
            "node": "Route: 1-Day vs 7-Day Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route: 1-Day vs 7-Day Reminder": {
      "main": [
        [
          {
            "node": "Send 7-Day Reminder (WhatsApp)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send 1-Day Reminder + Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send 7-Day Reminder (WhatsApp)": {
      "main": [
        [
          {
            "node": "Mark Reminder7 Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send 1-Day Reminder + Tickets": {
      "main": [
        [
          {
            "node": "Mark Reminder1 Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "c73cdedb-a61e-4e9d-8b0c-e376f4b1e847",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "9272721148ea09184b6bbb7ce6219dab088562dd450e2df8280d57c2e34c7d84"
  },
  "id": "fFsow336KD4EC0cMl3ToJ",
  "tags": []
}