{
  "name": "Generate hotel guest upsell recommendations with OpenAI, Sheets and Slack",
  "nodes": [
    {
      "id": "e75a2d38-6cb7-4512-bc09-f9b260ade174",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        304
      ],
      "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": "5201a5a0-190c-4be7-9c93-bea85bfae970",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -736,
        496
      ]
    },
    {
      "id": "c8ddf38b-c202-4f62-9d18-09ccb3202f96",
      "name": "Alert on Workflow Failure",
      "type": "n8n-nodes-base.slack",
      "position": [
        -480,
        496
      ]
    },
    {
      "id": "b6cca306-1f7a-45b8-8039-fab9c8db91c8",
      "name": "Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -912
      ],
      "parameters": {
        "width": 581,
        "height": 465,
        "content": "## 🏨 Automate Hotel Guest Upsells with AI using OpenAI, Sheets & Slack\n\n### How it works\nThis workflow reads guest data from Google Sheets daily at 9 AM, categorizes guests by stay status (before arri"
      }
    },
    {
      "id": "412568b2-011f-4c0e-a75c-a6fc352dfd4e",
      "name": "Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -336
      ],
      "parameters": {
        "width": 413,
        "height": 365,
        "content": "## 📥 Data Collection & Filtering\n\nRetrieves all guest records from Google Sheets and splits them into two paths based on stay status: guests arriving soon vs. currently checked in."
      }
    },
    {
      "id": "0b19920e-5484-427a-b0d0-7cc58ecb039b",
      "name": "Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -496
      ],
      "parameters": {
        "width": 509,
        "height": 717,
        "content": "## 🎯 Guest Context Preparation\n\nExtracts relevant guest attributes (name, room type, preferences, spending level, occasion) and adds stay phase context for AI processing."
      }
    },
    {
      "id": "603133eb-9ec2-4010-80cb-571db35681a0",
      "name": "Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -448
      ],
      "parameters": {
        "width": 485,
        "height": 601,
        "content": "## 🤖 AI Upsell Generation\n\nUses OpenAI to analyze guest profiles and recommend the single best upsell opportunity. Parses JSON response to extract offer type, personalized message, and reasoning."
      }
    },
    {
      "id": "4ad66e6d-5386-4117-a77f-e88fc709a198",
      "name": "Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -336
      ],
      "parameters": {
        "width": 453,
        "height": 457,
        "content": "## 💾 Update & Notify\n\nWrites the AI-generated upsell type back to the spreadsheet row and posts a formatted notification to Slack with guest details and offer reasoning."
      }
    },
    {
      "id": "76433870-e71c-4ab6-8d52-16231736b7e2",
      "name": "Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -112
      ],
      "parameters": {
        "width": 308.92307692307696,
        "height": 228.8615384615385,
        "content": "## 🔐 Credentials Required\n\n**Google Sheets:** OAuth2 with read/write permissions  \n**OpenAI:** API key with GPT-4o-mini access  \n**Slack:** App token with chat:write scope\n\nReplace all credential IDs "
      }
    },
    {
      "id": "f4896e43-6daf-4003-a35b-dcd65ae71407",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -672,
        -160
      ]
    },
    {
      "id": "a620855b-afd3-4fd5-ab61-cb7d511115a1",
      "name": "Google Sheets - Read Guests1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -464,
        -160
      ]
    },
    {
      "id": "45e8e114-7c4f-4e95-a5fe-6baab06037b1",
      "name": "IF - Before Arrival1",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -240
      ]
    },
    {
      "id": "2c0a027e-8dfb-4762-b3dc-52ba555085bc",
      "name": "IF - During Stay1",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        -32
      ]
    },
    {
      "id": "45f007e2-c271-4c43-8b1d-97144cfad522",
      "name": "Set - Guest Context (Before)1",
      "type": "n8n-nodes-base.set",
      "position": [
        64,
        -240
      ]
    },
    {
      "id": "ee71d128-47d6-4487-bad5-4a1abcac2550",
      "name": "Set - Guest Context (During)1",
      "type": "n8n-nodes-base.set",
      "position": [
        64,
        -32
      ]
    },
    {
      "id": "497b1353-f2a0-4acd-b88d-84b374eed0ec",
      "name": "AI - Generate Upsell1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        304,
        -128
      ]
    },
    {
      "id": "904506eb-1031-4d6d-a1a4-f21a186b329b",
      "name": "Code - Parse AI Response1",
      "type": "n8n-nodes-base.code",
      "position": [
        624,
        -128
      ]
    },
    {
      "id": "944add7d-4179-4107-860f-423dc5f123d5",
      "name": "Google Sheets - Update Row1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        848,
        -128
      ]
    },
    {
      "id": "b7cc0282-83b8-4fe4-b4dc-8a9ddf0e1e17",
      "name": "Slack - Notify Team1",
      "type": "n8n-nodes-base.slack",
      "position": [
        1072,
        -128
      ]
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Alert on Workflow Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - During Stay1": {
      "main": [
        [
          {
            "node": "Set - Guest Context (During)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Google Sheets - Read Guests1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Before Arrival1": {
      "main": [
        [
          {
            "node": "Set - Guest Context (Before)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Generate Upsell1": {
      "main": [
        [
          {
            "node": "Code - Parse AI Response1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Parse AI Response1": {
      "main": [
        [
          {
            "node": "Google Sheets - Update Row1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Update Row1": {
      "main": [
        [
          {
            "node": "Slack - Notify Team1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Read Guests1": {
      "main": [
        [
          {
            "node": "IF - Before Arrival1",
            "type": "main",
            "index": 0
          },
          {
            "node": "IF - During Stay1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set - Guest Context (Before)1": {
      "main": [
        [
          {
            "node": "AI - Generate Upsell1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set - Guest Context (During)1": {
      "main": [
        [
          {
            "node": "AI - Generate Upsell1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}