{
  "name": "Prevent employee burnout with AI analysis of Slack and tasks data to Google Sheets",
  "nodes": [
    {
      "id": "a7b9c8d2-3e4f-5678-9012-3456789abcde",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -752
      ],
      "parameters": {
        "width": 380,
        "height": 686,
        "content": "### 🧠 Employee Stress Monitor & Wellness Assistant\n\nThis workflow automates employee well-being monitoring by analyzing three data points: **Communication Tone (Slack)**, **Attendance**, and **Task Co"
      }
    },
    {
      "id": "b1c2d3e4-f5a6-7890-1234-567890abcdef",
      "name": "Run Daily at 2 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        400,
        48
      ]
    },
    {
      "id": "c3d4e5f6-a7b8-9012-3456-7890abcdef01",
      "name": "Note: Schedule",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        -96
      ],
      "parameters": {
        "width": 426,
        "height": 308,
        "content": "**📅 1. Schedule & Timeframe**\n- Trigger: Runs daily at 02:00 AM.\n- Code Node: Calculates the timestamp range for the previous 24 hours (00:00 - 23:59)."
      }
    },
    {
      "id": "d4e5f6a7-b8c9-0123-4567-890abcdef012",
      "name": "Calculate Analysis Period",
      "type": "n8n-nodes-base.code",
      "position": [
        624,
        48
      ]
    },
    {
      "id": "e5f6a7b8-c9d0-1234-5678-90abcdef0123",
      "name": "Note: Period Calculation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        -288
      ],
      "parameters": {
        "width": 698,
        "height": 404,
        "content": "**🤖 2. Data Aggregation & AI Analysis**\n- **Slack:** Fetches user messages and summarizes them.\n- **OpenAI:** Analyzes the tone/sentiment of the messages.\n- **Metrics:** Fetches Attendance (Work hours"
      }
    },
    {
      "id": "f6a7b8c9-d0e1-2345-6789-0abcdef01234",
      "name": "Fetch Employee List",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        848,
        48
      ]
    },
    {
      "id": "a7b8c9d0-e1f2-3456-7890-abcdef01234",
      "name": "Note: Fetch Employees",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3248,
        -256
      ],
      "parameters": {
        "width": 858,
        "height": 350,
        "content": "**🛡️ 3. Anonymization & Dashboard**\n- **Hashing:** Hashes the `Employee ID` to protect identity in the general report.\n- **Google Sheets:** Logs the anonymized stress score for HR trends/analytics."
      }
    },
    {
      "id": "b8c9d0e1-f2a3-4567-8901-bcdef0123456",
      "name": "Start Employee Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1072,
        48
      ]
    },
    {
      "id": "d0e1f2a3-b4c5-6789-0123-def012345678",
      "name": "Fetch Slack Messages",
      "type": "n8n-nodes-base.slack",
      "position": [
        1296,
        -96
      ]
    },
    {
      "id": "e1f2a3b4-c5d6-7890-1234-ef0123456789",
      "name": "Generate Message Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        -96
      ]
    },
    {
      "id": "f2a3b4c5-d6e7-8901-2345-f01234567890",
      "name": "AI Tone Analysis",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1744,
        -96
      ]
    },
    {
      "id": "b4c5d6e7-f8a9-0123-4567-123456789012",
      "name": "Format Data for Privacy",
      "type": "n8n-nodes-base.set",
      "position": [
        1968,
        -96
      ]
    },
    {
      "id": "c5d6e7f8-a9b0-1234-5678-234567890123",
      "name": "Fetch Attendance Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2192,
        -96
      ]
    },
    {
      "id": "d6e7f8a9-b0c1-2345-6789-345678901234",
      "name": "Calculate Attendance Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        2416,
        -96
      ]
    },
    {
      "id": "e7f8a9b0-c1d2-3456-7890-456789012345",
      "name": "Fetch Task Completion Rates",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2640,
        -96
      ]
    },
    {
      "id": "f8a9b0c1-d2e3-4567-8901-567890123456",
      "name": "Calculate Task Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        2864,
        -96
      ]
    },
    {
      "id": "a9b0c1d2-e3f4-5678-9012-678901234567",
      "name": "Consolidate Features",
      "type": "n8n-nodes-base.code",
      "position": [
        3088,
        -96
      ]
    },
    {
      "id": "b0c1d2e3-f4a5-6789-0123-789012345678",
      "name": "AI Stress Level Prediction",
      "type": "n8n-nodes-base.openAi",
      "position": [
        3312,
        -96
      ]
    },
    {
      "id": "c1d2e3f4-a5b6-7890-1234-890123456789",
      "name": "Note: Stress Prediction",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4144,
        -304
      ],
      "parameters": {
        "width": 682,
        "height": 452,
        "content": "**❤️ 4. Action & Intervention**\n- **Logic:** Checks if `stress_level` is \"High\".\n- **True:** Sends a private Slack DM to the employee suggesting counseling and logs the event in a restricted Postgres "
      }
    },
    {
      "id": "d2e3f4a5-b6c7-8901-2345-901234567890",
      "name": "Generate Anonymized Data",
      "type": "n8n-nodes-base.code",
      "position": [
        3536,
        -96
      ]
    },
    {
      "id": "e3f4a5b6-c7d8-9012-3456-012345678901",
      "name": "Filter Fields for HR Dashboard",
      "type": "n8n-nodes-base.set",
      "position": [
        3760,
        -96
      ]
    },
    {
      "id": "f4a5b6c7-d8e9-0123-4567-123456789012",
      "name": "Save to HR Dashboard",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3984,
        -96
      ]
    },
    {
      "id": "b6c7d8e9-f0a1-2345-6789-345678901234",
      "name": "Check for High Stress",
      "type": "n8n-nodes-base.if",
      "position": [
        4208,
        -96
      ]
    },
    {
      "id": "d8e9f0a1-b2c3-4567-8901-567890123456",
      "name": "Send Slack DM to High Stress Employee",
      "type": "n8n-nodes-base.slack",
      "position": [
        4432,
        -96
      ]
    },
    {
      "id": "f0a1b2c3-d4e5-6789-0123-789012345678",
      "name": "Log Counseling Proposal",
      "type": "n8n-nodes-base.postgres",
      "position": [
        4656,
        -32
      ]
    }
  ],
  "connections": {
    "AI Tone Analysis": {
      "main": [
        [
          {
            "node": "Format Data for Privacy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Daily at 2 AM": {
      "main": [
        [
          {
            "node": "Calculate Analysis Period",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Employee List": {
      "main": [
        [
          {
            "node": "Start Employee Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Employee Loop": {
      "main": [
        [
          {
            "node": "Fetch Slack Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate Features": {
      "main": [
        [
          {
            "node": "AI Stress Level Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Slack Messages": {
      "main": [
        [
          {
            "node": "Generate Message Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to HR Dashboard": {
      "main": [
        [
          {
            "node": "Check for High Stress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for High Stress": {
      "main": [
        [
          {
            "node": "Send Slack DM to High Stress Employee",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Start Employee Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Attendance Data": {
      "main": [
        [
          {
            "node": "Calculate Attendance Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Task Metrics": {
      "main": [
        [
          {
            "node": "Consolidate Features",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data for Privacy": {
      "main": [
        [
          {
            "node": "Fetch Attendance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Counseling Proposal": {
      "main": [
        [
          {
            "node": "Start Employee Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Anonymized Data": {
      "main": [
        [
          {
            "node": "Filter Fields for HR Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Message Summary": {
      "main": [
        [
          {
            "node": "AI Tone Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Analysis Period": {
      "main": [
        [
          {
            "node": "Fetch Employee List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Stress Level Prediction": {
      "main": [
        [
          {
            "node": "Generate Anonymized Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Task Completion Rates": {
      "main": [
        [
          {
            "node": "Calculate Task Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Attendance Metrics": {
      "main": [
        [
          {
            "node": "Fetch Task Completion Rates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Fields for HR Dashboard": {
      "main": [
        [
          {
            "node": "Save to HR Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Slack DM to High Stress Employee": {
      "main": [
        [
          {
            "node": "Log Counseling Proposal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}