{
  "name": "Automate hotel booking requests from Gmail to Google Sheets with GPT-5-mini",
  "nodes": [
    {
      "id": "a61671f5-447d-448c-8b56-bf68c3c1b6ee",
      "name": "IF (Guardrail Check)",
      "type": "n8n-nodes-base.if",
      "position": [
        -1680,
        624
      ]
    },
    {
      "id": "23a9e386-0d4c-44ac-a266-544d37b3f7ce",
      "name": "Merge Sanitized Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -416,
        720
      ]
    },
    {
      "id": "e1218ec7-0b51-40ef-adb9-c49f82eed024",
      "name": "Set Invalid Email Error",
      "type": "n8n-nodes-base.set",
      "position": [
        -1600,
        256
      ]
    },
    {
      "id": "9c278e2e-160a-48d8-8b08-053ee914d4a3",
      "name": "Log Invalid Email Error",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1312,
        256
      ]
    },
    {
      "id": "038fcd9d-afe8-4b1d-be58-09a6bb105deb",
      "name": "Send Invalid Email Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1008,
        256
      ]
    },
    {
      "id": "a1bd31b5-fcb3-46d5-b539-53a8b272c9b6",
      "name": "OpenAI Model for Email Text2",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1760,
        1424
      ]
    },
    {
      "id": "4b843e31-9ae1-4b72-8139-46ce8c6944cd",
      "name": "Guardrails",
      "type": "@n8n/n8n-nodes-langchain.guardrails",
      "position": [
        -608,
        944
      ]
    },
    {
      "id": "64d82eb3-1975-46c2-8526-a7a74cad009e",
      "name": "OpenAI Model for PDF",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1760,
        1136
      ]
    },
    {
      "id": "2da3c261-1a25-4891-a8ae-286a799d4eab",
      "name": "Filter Booking Emails",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1264,
        704
      ]
    },
    {
      "id": "82f52b5b-1212-4519-89c2-f4d0556b9d9d",
      "name": "Check for Attachment",
      "type": "n8n-nodes-base.if",
      "position": [
        -2352,
        1248
      ]
    },
    {
      "id": "c70932ce-9208-4f45-9f07-a8f412d9ae93",
      "name": "Extract Attachment Data",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -2064,
        1136
      ]
    },
    {
      "id": "c9390ca4-1f47-45e2-a5af-e3c7598969eb",
      "name": "Configuration: User Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -1888,
        272
      ]
    },
    {
      "id": "e8ed62e0-3f84-4545-b202-4f45959928fe",
      "name": "Get many messages (1)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -2400,
        640
      ]
    },
    {
      "id": "3d66a43d-b16c-4500-b655-b2dbf6c0a841",
      "name": "Look for incoming emails",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -2624,
        640
      ]
    },
    {
      "id": "708e6de8-8325-48e8-a89c-6bde44a06206",
      "name": "Validate Extraction",
      "type": "n8n-nodes-base.code",
      "position": [
        -1328,
        1264
      ]
    },
    {
      "id": "928fd9b5-f351-4f2f-a67d-e8ac424806c6",
      "name": "Apply Business Rules",
      "type": "n8n-nodes-base.code",
      "position": [
        -816,
        944
      ]
    },
    {
      "id": "0c8b2e33-a8fb-47eb-aff7-afcb7d37b006",
      "name": "Log Error to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -768,
        1520
      ]
    },
    {
      "id": "3dca72e3-0a38-433a-b1e5-e1ef571c6ba0",
      "name": "Send Error Notification",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -432,
        1520
      ]
    },
    {
      "id": "8615af32-9474-4add-9510-43a5ee171eb8",
      "name": "Guardrails1",
      "type": "@n8n/n8n-nodes-langchain.guardrails",
      "position": [
        -2192,
        640
      ]
    },
    {
      "id": "280d81bc-6abe-4260-87f7-79cd71188737",
      "name": "Log Team Assignment",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -48,
        944
      ]
    },
    {
      "id": "f276158f-b898-426e-8f63-e217b2294fc8",
      "name": "Append to Cases Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -48,
        720
      ]
    },
    {
      "id": "2499ed0d-a0cc-4ac5-9712-a075fab7edf6",
      "name": "Send Confirmation Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        208,
        720
      ]
    },
    {
      "id": "da69b08e-6254-47b4-8286-a656b98a9156",
      "name": "Log Success Metrics",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        720
      ]
    },
    {
      "id": "58dbbd37-8a9d-4007-912c-92e936048948",
      "name": "Check for Errors",
      "type": "n8n-nodes-base.if",
      "position": [
        -1056,
        1264
      ]
    },
    {
      "id": "389d5e49-5370-4b72-aed5-b35cc4d597c2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        1408
      ],
      "parameters": {
        "width": 528,
        "height": 976,
        "content": "## Error Notification\n\n![Data Flow Diagram](https://i.postimg.cc/tRvgMXT2/Screenshot-2025-11-07-at-00-54-22.png#full-width)"
      }
    },
    {
      "id": "afb55352-1c01-4a70-99ad-50b16773df64",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 464,
        "height": 592,
        "content": "## Confirmation Email\n\n![Data Flow Diagram](https://i.postimg.cc/X7yn1dtV/Screenshot-2025-11-07-at-00-36-19.png#full-width)"
      }
    },
    {
      "id": "aad71e5a-b332-4c43-b4cf-7eee83f6d3e0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1968,
        128
      ],
      "parameters": {
        "width": 256,
        "height": 304,
        "content": "### 3. Workflow configuration\n- Add your **google sheet ID*\n- Add the **email address** you want error notifications sent to."
      }
    },
    {
      "id": "424a7235-2496-4610-a0fe-4588cfd0cdcd",
      "name": "Sticky Note24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        1040
      ],
      "parameters": {
        "width": 432,
        "height": 400,
        "content": "## Validate the data and check for missing values\nChecks for:\n✓ Required fields present (agency, rooms, dates)\n✓ Valid date format (YYYY-MM-DD)\n✓ Check-out after check-in\n✓ No null/empty critical valu"
      }
    },
    {
      "id": "c0e9ffe0-0933-4d83-8888-0b950b3eea6e",
      "name": "Sticky Note21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        1408
      ],
      "parameters": {
        "width": 640,
        "height": 304,
        "content": "## ⚠️ Error Handling Flow\n### Any failures are logged and admins are notified"
      }
    },
    {
      "id": "5f4a9ac7-43a5-4939-8d84-83c816a711eb",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        912
      ],
      "parameters": {
        "width": 736,
        "height": 736,
        "content": "## Extract *data from PDF*\n### The Agent extracts the data from the attachment in mail and processes them. \nUses OpenAI GPT-4o-mini with JSON mode to extract:\n- Travel agency name, contact details\n- R"
      }
    },
    {
      "id": "cd241238-65ff-4937-9380-a9c22abfab56",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2688,
        448
      ],
      "parameters": {
        "width": 1568,
        "height": 432,
        "content": "## Mail extraction\n### Extract the mails thats have to do with booking or reservations.\n Filters emails by checking subject line for keywords:\n- \"Booking Request\", \"reservation\", \"room request\", \"acco"
      }
    },
    {
      "id": "6e1a215d-1e11-4666-9822-d544f2cc4051",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        608
      ],
      "parameters": {
        "width": 1248,
        "height": 560,
        "content": "## Log to *Case* and *Team Assignment* tables\n**- Make a copy of this sheet:**\nhttps://docs.google.com/spreadsheets/d/1qhUoE4baN5TyO51mD2caYU789XizhXl3UDCCT0v83So/copy"
      }
    },
    {
      "id": "89d8dd05-2bf0-4091-8931-38faeb6c81d6",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        656
      ],
      "parameters": {
        "width": 352,
        "height": 248,
        "content": "## 📊 Success Metrics Logger"
      }
    },
    {
      "id": "a8d4be9c-ab0d-4cfc-be2b-95936ba88017",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3216,
        416
      ],
      "parameters": {
        "width": 496,
        "height": 1168,
        "content": "# 🏨 Automate hotel booking requests from Gmail to Google Sheets using AI\n### **[Gtaras](https://n8n.io/creators/tarasidis/)**  \n\nThis workflow automates *hotel booking requests that come in through Gm"
      }
    },
    {
      "id": "40f8bf83-bed7-4259-a216-ce6840750317",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        128
      ],
      "parameters": {
        "width": 800,
        "height": 304,
        "content": "## ⚠️ Error Handling Flow\n### Any failures are logged and admins are notified"
      }
    },
    {
      "id": "5edbeb68-2d3e-49ab-ba38-03e3f3df80fa",
      "name": "GEMINI 2.5 FLASH",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -2192,
        736
      ]
    },
    {
      "id": "01fe2d7a-0a01-4a65-99f4-57d6a4c301f2",
      "name": "CHAT GPT 5 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1760,
        1296
      ]
    }
  ],
  "connections": {
    "Guardrails": {
      "main": [
        [
          {
            "node": "Merge Sanitized Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guardrails1": {
      "main": [
        [
          {
            "node": "Configuration: User Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CHAT GPT 5 mini": {
      "ai_languageModel": [
        [
          {
            "node": "OpenAI Model for PDF",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "OpenAI Model for Email Text2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check for Errors": {
      "main": [
        [
          {
            "node": "Apply Business Rules",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Error to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GEMINI 2.5 FLASH": {
      "ai_languageModel": [
        [
          {
            "node": "Guardrails1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Log Error to Sheet": {
      "main": [
        [
          {
            "node": "Send Error Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Extraction": {
      "main": [
        [
          {
            "node": "Check for Errors",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Business Rules": {
      "main": [
        [
          {
            "node": "Log Team Assignment",
            "type": "main",
            "index": 0
          },
          {
            "node": "Guardrails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Attachment": {
      "main": [
        [
          {
            "node": "Extract Attachment Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OpenAI Model for Email Text2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF (Guardrail Check)": {
      "main": [
        [
          {
            "node": "Filter Booking Emails",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Invalid Email Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Sanitized Data": {
      "main": [
        [
          {
            "node": "Append to Cases Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model for PDF": {
      "main": [
        [
          {
            "node": "Validate Extraction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append to Cases Sheet": {
      "main": [
        [
          {
            "node": "Send Confirmation Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Booking Emails": {
      "main": [
        [
          {
            "node": "Check for Attachment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many messages (1)": {
      "main": [
        [
          {
            "node": "Guardrails1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Attachment Data": {
      "main": [
        [
          {
            "node": "OpenAI Model for PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Invalid Email Error": {
      "main": [
        [
          {
            "node": "Send Invalid Email Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Confirmation Email": {
      "main": [
        [
          {
            "node": "Log Success Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Invalid Email Error": {
      "main": [
        [
          {
            "node": "Log Invalid Email Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Look for incoming emails": {
      "main": [
        [
          {
            "node": "Get many messages (1)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration: User Settings": {
      "main": [
        [
          {
            "node": "IF (Guardrail Check)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model for Email Text2": {
      "main": [
        [
          {
            "node": "Validate Extraction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}