Quick overview
This monthly workflow reads employee and leave data from Google Sheets, calculates who risks missing Japan’s mandatory paid-leave minimum, generates Japanese reminder copy with Google Gemini, then emails employees via Gmail, posts a summary to Slack, and logs each notification back to Google Sheets.
How it works
- Runs on the first day of each month.
- Loads the employee roster and paid-leave records from two tabs in Google Sheets and combines them by employee ID.
- Calculates each active employee’s current leave-year grant date, deadline, days taken, and remaining shortfall against the required minimum.
- Keeps only employees who still have a shortfall and whose deadline is within the configured alert window.
- Uses Google Gemini to generate two Japanese messages: a short employee-friendly reminder and a one-line HR summary.
- Sends the employee reminder via Gmail, posts the HR summary to a Slack channel, and appends a record of the notification to a Google Sheets log tab.
Setup
- Add credentials for Google Sheets, Google Gemini (PaLM) API, Gmail, and Slack.
- Provide your Google Sheets spreadsheet ID in the configuration values and ensure it contains the tabs Employees, LeaveLog, and NotificationLog with the expected columns (including employeeId).
- Set your leave rules in the configuration values (grantMethod and fixedGrantMonthDay if used, requiredDays, and alertBeforeDays).
- Set the target Slack channel name in the configuration values (and invite the Slack app/bot to that channel).
- Confirm employee email addresses and leave dates are stored in a format the workflow can parse (YYYY-MM-DD), then run once and activate.