{
  "name": "Send employee leave alerts from Google Sheets via Slack and Gmail",
  "nodes": [
    {
      "id": "generated-6ace5735-9c46-454a-aef7-196487beb8d3",
      "name": "Holiday Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -496
      ],
      "parameters": {
        "width": 518,
        "height": 664,
        "content": "## Workflow Overview\n\n### How it works \n\nThis workflow automatically manages employee leave notifications based on a central Google Sheet. Every day at a scheduled time, it checks whether any employee"
      }
    },
    {
      "id": "generated-80e8e821-a933-4601-8b0a-6d3af492e1a0",
      "name": "Daily Leave Check Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        144,
        64
      ]
    },
    {
      "id": "c5d33038-aba0-497b-9aaf-2fdb19b47f1c",
      "name": "Fetch Leave Records",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        352,
        64
      ]
    },
    {
      "id": "44ed6649-3b28-43d4-9ea1-604c51e46b0b",
      "name": "Validate & Normalize Leave Data",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        64
      ]
    },
    {
      "id": "generated-baa5999e-cb81-460b-975f-8e53e0c7627b",
      "name": "Check Needs Activation",
      "type": "n8n-nodes-base.if",
      "position": [
        928,
        64
      ]
    },
    {
      "id": "18952c94-d843-44f8-9ca5-dc89917dafb7",
      "name": "Check Needs Reset",
      "type": "n8n-nodes-base.if",
      "position": [
        1104,
        288
      ]
    },
    {
      "id": "b53131b4-d779-4483-b0ce-ce5f1d7ec28f",
      "name": "Process Activations Sequentially",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1296,
        16
      ]
    },
    {
      "id": "1f73b0d8-bee5-49e8-bfad-3e3f2f237409",
      "name": "Notify HR Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        1584,
        32
      ]
    },
    {
      "id": "84e16891-9f27-4447-9dfe-15f62f61d0b0",
      "name": "Send OOO Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1792,
        32
      ]
    },
    {
      "id": "2b00a36a-857e-42e7-a798-5460fd639373",
      "name": "Process Resets Sequentially",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1392,
        272
      ]
    },
    {
      "id": "5e70ba30-ba79-4701-9b5b-f7acc759cd3d",
      "name": "Notify HR Leave Reset",
      "type": "n8n-nodes-base.slack",
      "position": [
        1680,
        288
      ]
    },
    {
      "id": "c9207def-24de-49cd-b012-42b83302c648",
      "name": "Send Welcome Back Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1888,
        288
      ]
    },
    {
      "id": "2d6c5d35-a7a2-4208-8233-efaf14be065a",
      "name": "Mark Leave As Inactive",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2112,
        288
      ]
    },
    {
      "id": "07b1bdf9-8ed4-444a-b2c8-ff9ba89c71f7",
      "name": "Mark Leave as Active",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2016,
        32
      ]
    },
    {
      "id": "ecf90988-0392-4baf-96fe-1f7231651c7c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -128
      ],
      "parameters": {
        "width": 1360,
        "height": 384,
        "content": "Handles employees whose leave starts today. Sends Slack notification, emails reminder, updates sheet status, and prevents duplicate activations."
      }
    },
    {
      "id": "6c36d41d-6c25-4249-9f25-44ca1a123fcd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        272
      ],
      "parameters": {
        "width": 1264,
        "height": 352,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nHandles employees whose leave has ended. Sends return notification, emails reminder, and resets status to inactive in the sheet."
      }
    },
    {
      "id": "54ffe19f-2914-4561-b209-2bf5493623c6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        -80
      ],
      "parameters": {
        "width": 752,
        "height": 368,
        "content": "Triggers daily execution, loads configuration values, reads leave records from Google Sheets, validates inputs, and calculates activation and reset conditions."
      }
    }
  ],
  "connections": {
    "Check Needs Reset": {
      "main": [
        [
          {
            "node": "Process Resets Sequentially",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify HR Channel": {
      "main": [
        [
          {
            "node": "Send OOO Reminder Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Leave Records": {
      "main": [
        [
          {
            "node": "Validate & Normalize Leave Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Leave as Active": {
      "main": [
        [
          {
            "node": "Process Activations Sequentially",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify HR Leave Reset": {
      "main": [
        [
          {
            "node": "Send Welcome Back Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Needs Activation": {
      "main": [
        [
          {
            "node": "Process Activations Sequentially",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check Needs Reset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Leave As Inactive": {
      "main": [
        [
          {
            "node": "Process Resets Sequentially",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send OOO Reminder Email": {
      "main": [
        [
          {
            "node": "Mark Leave as Active",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Welcome Back Email": {
      "main": [
        [
          {
            "node": "Mark Leave As Inactive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Leave Check Trigger": {
      "main": [
        [
          {
            "node": "Fetch Leave Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Resets Sequentially": {
      "main": [
        [],
        [
          {
            "node": "Notify HR Leave Reset",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate & Normalize Leave Data": {
      "main": [
        [
          {
            "node": "Check Needs Activation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Activations Sequentially": {
      "main": [
        [],
        [
          {
            "node": "Notify HR Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}