Monitor overtime risk against Japanese labour caps with Gemini, Sheets, Slack & Gmail

Go to Workflow
0 views
Built by Oka Hironobu Oka Hironobu
Created on July 28, 2026

Description

Quick Overview
This workflow runs weekly to read attendance overtime from Google Sheets, totals it per employee and month, uses Google Gemini to classify risk against Japanese labour-law limits, writes results back to Sheets, and escalates high-risk cases via Slack and a Gmail draft.

How it works
Runs every week on a schedule.
Loads configured Japanese overtime limits and fetches raw attendance rows from a Google Sheets “Attendance” worksheet.
Aggregates overtime hours per employee per month.
Sends each employee-month total to Google Gemini, which returns a structured risk level (over/approaching/ok) plus a short summary and recommended manager actions.
Stores or updates the assessment in a Google Sheets “Overtime Status” worksheet keyed by employee and month.
Posts to Slack when overtime is over the cap (and drafts a manager notice in Gmail), posts an early-warning Slack message when approaching the cap, and flags unclear or failed assessments to Slack for manual review.

Setup
Add credentials for Google Sheets OAuth, Google Gemini (PaLM) API, Slack OAuth2, and Gmail OAuth2.
Create a Google Sheets spreadsheet with an “Attendance” sheet containing Employee (or Name), Month (or Date), and Overtime Hours columns, plus an “Overtime Status” sheet for the upserted results.
Select your spreadsheet and the correct sheet names in the Google Sheets nodes, and set the target Slack channel (for example, #hr) in the Slack message steps.
Review and adjust the legal limits and warning threshold values used for classification in the limits configuration step.

Nodes Used (7)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Google Sheets
n8n-nodes-base.googleSheets
Slack
n8n-nodes-base.slack
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured