{
  "name": "Classify guest enquiries and send replies with GPT-4o, Gmail and Slack",
  "nodes": [
    {
      "id": "f3a5e0ab-84fe-4751-810f-302bb31b2fb3",
      "name": "Overview Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2304,
        656
      ],
      "parameters": {
        "width": 656,
        "height": 448,
        "content": "## 🏨 Automate Guest Enquiry Classification & Replies with Base44 and GPT-4o\n### How it works\nThis workflow automates guest enquiry handling for hospitality businesses. When a guest submits an enquiry "
      }
    },
    {
      "id": "b5f5bb78-714d-4573-830f-237977501e34",
      "name": "Section: Trigger & AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        1312
      ],
      "parameters": {
        "width": 672,
        "height": 784,
        "content": "## 📥 Webhook Trigger & AI Classification\n\nReceives guest enquiry data via POST webhook and routes it to the AI agent for intent detection and reply generation."
      }
    },
    {
      "id": "0d793a02-3d82-4e96-af78-da33a3150657",
      "name": "Section: Routing Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        1392
      ],
      "parameters": {
        "width": 512,
        "height": 464,
        "content": "## 🧠 Intent Detection & Assignment\n\nExtracts the detected category and routes enquiries to specialized teams based on intent: booking, pricing, availability, or policy questions."
      }
    },
    {
      "id": "a2cc319a-d0b4-4f34-80dc-a593cfd74a64",
      "name": "Section: Assignment",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        1136
      ],
      "parameters": {
        "width": 352,
        "height": 928,
        "content": "## 📋 Team Assignment & SLA Configuration\n\nAssigns enquiries to specific agents with appropriate SLA timeframes based on urgency and category type."
      }
    },
    {
      "id": "01fff883-82bb-4c88-a00a-395b8017861b",
      "name": "Section: Notifications",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1200
      ],
      "parameters": {
        "width": 944,
        "height": 832,
        "content": "## 📬 Guest Communication & Internal Alerts\n\nSends personalized email replies to guests who prefer email contact, and posts detailed enquiry summaries to Slack for team visibility and follow-up trackin"
      }
    },
    {
      "id": "0214ad46-12b2-4d6f-a9a4-449f566d4391",
      "name": "Credentials & Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        1760
      ],
      "parameters": {
        "width": 352,
        "height": 240,
        "content": "## 🔐 Required Credentials\n\n- **Gmail OAuth2**: For automated email replies\n- **Slack API**: For internal team notifications\n- **OpenAI API**: For AI intent classification\n\nReplace all email addresses "
      }
    },
    {
      "id": "b531d9c3-e473-42ee-883b-f579ed75f646",
      "name": "Extract Detected Category",
      "type": "n8n-nodes-base.set",
      "position": [
        -736,
        1584
      ]
    },
    {
      "id": "cb927eca-6845-4fe8-b397-d09aade3fada",
      "name": "Route by Intent Category",
      "type": "n8n-nodes-base.switch",
      "position": [
        -528,
        1552
      ]
    },
    {
      "id": "5ba0d741-78d4-400f-b9a2-012180c04396",
      "name": "Assign to Booking Team",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        1312
      ]
    },
    {
      "id": "6fd1f956-618b-4c9d-b41e-6aec997df67f",
      "name": "Assign to Pricing Team",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        1536
      ]
    },
    {
      "id": "5112c56d-7d67-4d6d-bdb2-d734b86eb18d",
      "name": "Assign to Availability Team",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        1712
      ]
    },
    {
      "id": "28c17d78-3872-441e-86e1-2ff7ffbcbfe8",
      "name": "Assign to Policy Team",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        1920
      ]
    },
    {
      "id": "b823b845-06cd-4ee2-a2c3-3dcd1ec846e5",
      "name": "Send Email Reply to Guest",
      "type": "n8n-nodes-base.gmail",
      "position": [
        656,
        1312
      ]
    },
    {
      "id": "93fab7ad-57b4-432f-a28f-55db17797cd3",
      "name": "AI Agent: Classify Intent & Generate Reply",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1136,
        1584
      ]
    },
    {
      "id": "becdc5c0-f877-498d-8eac-ac30769cf9b7",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1232,
        1808
      ]
    },
    {
      "id": "f40057e5-a57b-4ed4-af20-630c1cb43d8c",
      "name": "Check Guest Contact Preference",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        1584
      ]
    },
    {
      "id": "12845d04-d9dd-42f7-a07a-ef797945b1e8",
      "name": "Post Enquiry Summary to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        960,
        1568
      ]
    },
    {
      "id": "e51485ee-b29e-47b4-a4cf-131069440fdc",
      "name": "Log AI Reply to Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        704,
        1856
      ]
    },
    {
      "id": "c0946753-44ef-44bd-a79b-09e69c193dae",
      "name": "Webhook Trigger1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1440,
        1584
      ]
    },
    {
      "id": "26d1a483-43b4-4907-90fe-4e7b2a8bd23a",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -960,
        1824
      ]
    },
    {
      "id": "efc4b764-0993-44ac-aed2-9796e055fdb4",
      "name": "Error Handler Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1504,
        2480
      ]
    },
    {
      "id": "722f321d-f5ec-44f4-b36d-62b912501338",
      "name": "Slack: Send Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1136,
        2480
      ]
    },
    {
      "id": "6023367a-c592-4cf3-82e1-8773c2dc2b5c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        2320
      ],
      "parameters": {
        "width": 672,
        "height": 336,
        "content": "## 🚨 Error Handling \n\n \nCatches any workflow failure and posts an alert to Slack.  \nIncludes node name, error message, and timestamp for quick debugging.\n"
      }
    }
  ],
  "connections": {
    "Webhook Trigger1": {
      "main": [
        [
          {
            "node": "AI Agent: Classify Intent & Generate Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Classify Intent & Generate Reply",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Policy Team": {
      "main": [
        [
          {
            "node": "Check Guest Contact Preference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Handler Trigger": {
      "main": [
        [
          {
            "node": "Slack: Send Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Booking Team": {
      "main": [
        [
          {
            "node": "Check Guest Contact Preference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Pricing Team": {
      "main": [
        [
          {
            "node": "Check Guest Contact Preference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Intent Category": {
      "main": [
        [
          {
            "node": "Assign to Booking Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Assign to Pricing Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Assign to Availability Team",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Assign to Policy Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Detected Category": {
      "main": [
        [
          {
            "node": "Route by Intent Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent: Classify Intent & Generate Reply",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Assign to Availability Team": {
      "main": [
        [
          {
            "node": "Check Guest Contact Preference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Guest Contact Preference": {
      "main": [
        [
          {
            "node": "Send Email Reply to Guest",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Enquiry Summary to Slack",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log AI Reply to Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Post Enquiry Summary to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Classify Intent & Generate Reply": {
      "main": [
        [
          {
            "node": "Extract Detected Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}