{
  "name": "Send personalized hotel pre-arrival messages using OpenAI, Google Sheets and Slack",
  "nodes": [
    {
      "id": "9a2106b5-c91b-4f2a-8ef8-21f11461b74e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        864
      ],
      "parameters": {
        "width": 738,
        "height": 510,
        "content": "## 🏨 AI-Powered Guest Pre-Arrival Experience Automation using OpenAI, Google Sheets & Slack\n\n### How it works\nThis workflow manages hotel guest profiles and sends personalized pre-arrival messages. It"
      }
    },
    {
      "id": "c7b0ee5d-6945-413a-8b17-74844b99914f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        1312
      ],
      "parameters": {
        "width": 416,
        "height": 404,
        "content": "## 📅 Scheduled Data Retrieval\n\nRuns daily to fetch all guest reservations from Google Sheets. The sheet contains guest profiles with contact info, preferences, allergies, and check-in dates.\n\nSheet1 s"
      }
    },
    {
      "id": "9fbc1e1e-2688-44a5-8d23-dd307ec1764d",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        1248
      ],
      "parameters": {
        "width": 636,
        "height": 648,
        "content": "## 👤 Smart Profile Management\n\nChecks if the guest has stayed before (existing guest_id). Returning guests get their profiles merged — combining new preferences with historical data like visit count a"
      }
    },
    {
      "id": "826ac01d-36cc-41c9-b1b0-45105f749757",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        1280
      ],
      "parameters": {
        "width": 428,
        "height": 516,
        "content": "## ⏰ Pre-Arrival Window Detection\n\nCalculates days remaining until check-in and filters for guests arriving within 2 days. Only those within the window proceed to message generation, preventing spam."
      }
    },
    {
      "id": "0b555a00-2c42-4ae3-abef-8f181cdc083b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        1280
      ],
      "parameters": {
        "width": 280,
        "height": 504,
        "content": "## 🤖 AI Message Personalization\n\nGenerates warm, context-aware welcome messages using OpenAI. The prompt includes guest name, room preference, dietary needs, special occasions, and visit history to cr"
      }
    },
    {
      "id": "51141e51-a832-4c20-a989-0453e50e339c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2704,
        1168
      ],
      "parameters": {
        "width": 516,
        "height": 828,
        "content": "## 📬 Multi-Channel Delivery\n\nRoutes messages based on available contact info. If phone number exists, sends via Slack and logs to Sheet3. Otherwise, falls back to email. This ensures every guest recei"
      }
    },
    {
      "id": "031ad87f-d70d-4fa7-99f7-e2405b10274c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        1984
      ],
      "parameters": {
        "width": 492,
        "height": 400,
        "content": "## ⚠️ Error Monitoring\n\nCatches any workflow failures and sends alerts to Slack's general-information channel. Helps maintain reliability and enables quick troubleshooting."
      }
    },
    {
      "id": "fa4c768c-8190-42c7-9634-bb46a053b97b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3248,
        1568
      ],
      "parameters": {
        "width": 400,
        "height": 268,
        "content": "## 🔐 Required Credentials\n\n- Google Sheets OAuth2 (read/write access)\n- OpenAI API key (GPT models)\n- Slack workspace token\n- SMTP email credentials\n\nReplace all example emails and IDs with your own b"
      }
    },
    {
      "id": "2b46b385-9eab-457c-bc4f-b3227407bdf1",
      "name": "Guest Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        1344,
        1552
      ]
    },
    {
      "id": "0fb67aae-38de-4349-a014-7b5f32ff1608",
      "name": "Merge Returning Guest Data",
      "type": "n8n-nodes-base.function",
      "position": [
        1568,
        1456
      ]
    },
    {
      "id": "510c6693-3212-48b2-8d86-45d88882e89e",
      "name": "Create First-Time Guest Profile",
      "type": "n8n-nodes-base.function",
      "position": [
        1568,
        1648
      ]
    },
    {
      "id": "c6f57f00-ee0e-4b2a-b900-a7631dfadffa",
      "name": "Calculate Days Until Check-In",
      "type": "n8n-nodes-base.function",
      "position": [
        2016,
        1552
      ]
    },
    {
      "id": "e838ef49-240f-4608-ab15-7870ab7bff37",
      "name": "Within 2-Day Window?",
      "type": "n8n-nodes-base.if",
      "position": [
        2240,
        1552
      ]
    },
    {
      "id": "8c4608a4-a60c-4191-bd09-0692096c27a6",
      "name": "Generate Personalized Welcome Message",
      "type": "n8n-nodes-base.openAi",
      "position": [
        2480,
        1552
      ]
    },
    {
      "id": "a89960f4-b813-4529-a151-7c008542f1f2",
      "name": "Check Message Generated",
      "type": "n8n-nodes-base.if",
      "position": [
        2736,
        1552
      ]
    },
    {
      "id": "ecc7fee8-0d7d-450b-bfb4-1ca9a05f5b25",
      "name": "Send Welcome Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2960,
        1744
      ]
    },
    {
      "id": "a7cbb5df-9fea-4864-bc1e-dd4da8a2e84d",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        944,
        2176
      ]
    },
    {
      "id": "3253626b-141e-468f-9477-86763ab4d586",
      "name": "Fetch Guest Profiles",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1120,
        1552
      ]
    },
    {
      "id": "dd75cf6f-7a2e-41bf-acca-582e02f773d5",
      "name": "Daily Check Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        896,
        1552
      ]
    },
    {
      "id": "2675403a-de2a-4290-b069-314536b63a98",
      "name": "Save Updated Profile",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1792,
        1552
      ]
    },
    {
      "id": "c6eddf59-9708-48ec-9c70-a806707858b7",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2960,
        1360
      ]
    },
    {
      "id": "8accf523-9b18-441e-8b82-55dbcd301867",
      "name": "Log Message to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2960,
        1552
      ]
    },
    {
      "id": "b0c619f9-5d1b-4c2a-939a-697fb72977db",
      "name": "Alert on Workflow Failure",
      "type": "n8n-nodes-base.slack",
      "position": [
        1200,
        2176
      ]
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Alert on Workflow Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guest Exists?": {
      "main": [
        [
          {
            "node": "Merge Returning Guest Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create First-Time Guest Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Check Schedule": {
      "main": [
        [
          {
            "node": "Fetch Guest Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Guest Profiles": {
      "main": [
        [
          {
            "node": "Guest Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Updated Profile": {
      "main": [
        [
          {
            "node": "Calculate Days Until Check-In",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Within 2-Day Window?": {
      "main": [
        [],
        [
          {
            "node": "Generate Personalized Welcome Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Message Generated": {
      "main": [
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Message to Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Returning Guest Data": {
      "main": [
        [
          {
            "node": "Save Updated Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Days Until Check-In": {
      "main": [
        [
          {
            "node": "Within 2-Day Window?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create First-Time Guest Profile": {
      "main": [
        [
          {
            "node": "Save Updated Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Welcome Message": {
      "main": [
        [
          {
            "node": "Check Message Generated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}