{
  "name": "Google Calendar to Slack Status & Philips Hue",
  "nodes": [
    {
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        420,
        420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        720,
        600
      ],
      "parameters": {
        "eventId": "={{$node[\"Event Started\"].json[\"id\"].split(\"_\")[0]}}",
        "options": {},
        "calendar": "user@example.com",
        "operation": "get"
      },
      "typeVersion": 1
    },
    {
      "name": "Light - Busy",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        180
      ],
      "parameters": {
        "url": "WEBHOOK1",
        "options": {},
        "requestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "name": "Light - Available",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        600
      ],
      "parameters": {
        "url": "WEBHOOK3",
        "options": {},
        "requestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1040,
        460
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "4dw_doing",
              "operation": "startsWith"
            },
            {
              "value2": "4dw_managing",
              "operation": "startsWith"
            },
            {
              "value2": "4dw_leading",
              "operation": "startsWith"
            },
            {
              "output": 1,
              "value2": "4dw_living",
              "operation": "startsWith"
            }
          ]
        },
        "value1": "={{$json[\"calColor\"]}}",
        "dataType": "string",
        "fallbackOutput": 3
      },
      "typeVersion": 1
    },
    {
      "name": "Light - Personal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1220,
        340
      ],
      "parameters": {
        "url": "WEBHOOK2",
        "options": {},
        "requestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "name": "Event Started",
      "type": "n8n-nodes-base.googleCalendarTrigger",
      "position": [
        540,
        600
      ],
      "parameters": {
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 5
            }
          ]
        },
        "triggerOn": "eventStarted",
        "calendarId": "REPLACE_WITH_CALENDARID"
      },
      "typeVersion": 1
    },
    {
      "name": "Slack - Status",
      "type": "n8n-nodes-base.slack",
      "position": [
        1040,
        720
      ],
      "parameters": {
        "resource": "userProfile",
        "operation": "update",
        "additionalFields": {
          "status_text": "={{$json[\"summary\"]}}",
          "status_emoji": "=:{{$json[\"calColor\"]}}:"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Set CalColor",
      "type": "n8n-nodes-base.function",
      "position": [
        880,
        600
      ],
      "parameters": {
        "functionCode": "for (item of items) {\n\n  switch (item.json.colorId) {\n    case '1':\n      calColor = 'Lavendar';\n      break;\n    case '2':\n      calColor = '4dw_leading';\n      break;\n    case '3':\n      calColor = 'Grape';\n      break;\n    case '4':\n      calColor = 'Flamingo';\n      break;\n    case '5':\n      calColor = '4dw_managing';\n      break;\n    case '6':\n      calColor = 'Tangerine';\n      break;\n    case '7':\n      calColor = '4dw_living';\n      break;\n    case '8':\n      calColor = 'Graphite';\n      break;\n    case '9':\n      calColor = 'Blueberry';\n      break;\n    case '10':\n      calColor = 'Basil';\n      break;\n    case '11':\n      calColor = '4dw_doing';\n      break;\n    default:\n      calColor = 'undefined';\n  }\n  item.json.calColor = calColor;\n}\n\nreturn items;"
      },
      "typeVersion": 1
    },
    {
      "id": "bad62ab0-9b77-5d11-b73c-fbcfe93148ba",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# Google Calendar to Slack Status & Philips Hue\n\n## Purpose and structure\nThis folder contains the **Google Calendar to Slack Status & Philips Hue** workflow. Its executable nodes use `function`, `googleCalendar`, `googleCalendarTrigger`, `httpRequest`, `manualTrigger`, `slack`, `switch`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nOn clicking 'execute', Event Started\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Manual/0078_Manual_Slack_Monitor_Webhook.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {},
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Light - Busy",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Light - Personal",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [
          {
            "node": "Light - Available",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set CalColor": {
      "main": [
        [
          {
            "node": "Slack - Status",
            "type": "main",
            "index": 0
          },
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Event Started": {
      "main": [
        [
          {
            "node": "Google Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "main": [
        [
          {
            "node": "Set CalColor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        []
      ]
    }
  }
}
