{
  "name": "Smart Gmail auto-replies while out of office with AI",
  "nodes": [
    {
      "id": null,
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1632,
        160
      ]
    },
    {
      "id": null,
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1648,
        384
      ]
    },
    {
      "id": null,
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1776,
        384
      ]
    },
    {
      "id": null,
      "name": "Check Email on Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        288,
        288
      ]
    },
    {
      "id": null,
      "name": "Define OOO Dates and Contact",
      "type": "n8n-nodes-base.set",
      "position": [
        512,
        288
      ]
    },
    {
      "id": null,
      "name": "Check If Currently OOO",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        288
      ]
    },
    {
      "id": null,
      "name": "Get Unread Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        960,
        288
      ]
    },
    {
      "id": null,
      "name": "Process Each Email",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1184,
        288
      ]
    },
    {
      "id": null,
      "name": "Fetch Email Content",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1408,
        160
      ]
    },
    {
      "id": null,
      "name": "Decide If Reply Is Needed",
      "type": "n8n-nodes-base.if",
      "position": [
        1984,
        160
      ]
    },
    {
      "id": null,
      "name": "Send AI-Powered Auto-Reply",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2208,
        160
      ]
    },
    {
      "id": null,
      "name": "Tag Replied Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2432,
        288
      ]
    },
    {
      "id": null,
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        32
      ],
      "parameters": {
        "width": 256,
        "height": 512,
        "content": "### 🗓️ Set your OOO dates and contact info\n\n- Set the values for ooo_start and ooo_end in ISO 8601 format (e.g., 2025-08-19T07:00:00+02:00)\n- Your local timezone (e.g., Europe/Madrid)\n- A fallback con"
      }
    },
    {
      "id": null,
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2368,
        48
      ],
      "parameters": {
        "width": 304,
        "height": 448,
        "content": "### 🏷️ Replace label ID with your own Gmail label\n\n• In this node, replace the current labelIds value with one from your Gmail account.\n• You can create a new label like “Auto-Replied” and copy its ID"
      }
    },
    {
      "id": null,
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        32
      ],
      "parameters": {
        "width": 304,
        "height": 512,
        "content": "### 🔁 Adjust how often the workflow runs\n\n• In the Schedule Trigger node, update the time interval to control how frequently it checks emails."
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Decide If Reply Is Needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unread Emails": {
      "main": [
        [
          {
            "node": "Process Each Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Email": {
      "main": [
        [
          {
            "node": "Fetch Email Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag Replied Emails": {
      "main": [
        [
          {
            "node": "Process Each Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Email Content": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Currently OOO": {
      "main": [
        [
          {
            "node": "Get Unread Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Email on Schedule": {
      "main": [
        [
          {
            "node": "Define OOO Dates and Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Decide If Reply Is Needed": {
      "main": [
        [
          {
            "node": "Send AI-Powered Auto-Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send AI-Powered Auto-Reply": {
      "main": [
        [
          {
            "node": "Tag Replied Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define OOO Dates and Contact": {
      "main": [
        [
          {
            "node": "Check If Currently OOO",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}