n8n

How to Automate Google Calendar Payroll Absences?

Send a clear month end summary of holidays and sick days to your payroll team without manual work. Great for HR and finance teams that track absences in Google Calendar and need accurate totals for pay and records.

On the first day of each month at 8am, a schedule starts the run. The flow calculates the previous month date, then pulls all calendar events within that window from Google Calendar. Each event is checked for the words Holiday or Illness in the summary. Separate paths map the person’s name from the event description and count the number of days by comparing the start and end dates. Two code steps add up days per person for holiday and illness, then the results are merged. A final code step builds a clean message, and an email node sends it to payroll via SMTP.

You need a Google Calendar that stores absences and uses consistent wording in the event summary. Choose the right calendar in the node, confirm the time window, and set your email sender. Expect a fast monthly report, fewer errors, and better payroll accuracy. Helpful for HR teams that track leave in Google Calendar and want a simple monthly rollup.

What are the key features?

  • Monthly schedule triggers on the first day at 8am for hands off reporting
  • Automatic previous month date calculation to set the reporting window
  • Google Calendar event fetch with full list returned for the period
  • Keyword based routing that classifies events as holiday or illness
  • Day counting logic that compares event start and end dates
  • Per person aggregation that totals days for each absence type
  • Message builder that formats a readable email for payroll
  • SMTP email send using Mailtrap for safe testing

What are the benefits?

  • Reduce manual tracking from hours each month to a few minutes
  • Improve absence totals accuracy by removing spreadsheet errors
  • Send a consistent report to payroll on the same day every month
  • Unify holiday and illness data in one simple email
  • Scale to more staff without extra admin work

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Calendar and Mailtrap. See the Tools Required section above for links to create accounts with these services.
  3. In n8n, open the Google Calendar node named Get previous months events. In the Credential to connect with field, click Create new credential. Choose Google Calendar OAuth2 and follow the on screen steps to sign in and grant access.
  4. In the same Google Calendar node, select the correct calendar that holds absence events. Keep operation as Get All and make sure Return All is enabled.
  5. Open the DateTime node named Previous Month and confirm it subtracts 1 month from the current date. This defines the start of the reporting window.
  6. Check the Switch node named Check Summary for Illness or Holiday. Make sure your event summaries include the words Holiday or Illness so events route correctly.
  7. Open the Set nodes for Filter Holiday Days and Filter Illness Days. Confirm the Name field pulls from the event description and that Days is calculated from the start and end dates.
  8. Open the Email node named Send email to payroll. In Credential to connect with, click Create new credential. Choose SMTP. In your Mailtrap dashboard, copy the SMTP host, port, username, and password into the credential fields, then save.
  9. In the Email node, set the To email to your payroll inbox and From email to a valid sender. Keep the subject Absences from last month or adjust to your naming.
  10. Run a test by executing the workflow manually once. Check the Mailtrap inbox to see the formatted message and confirm totals look right.
  11. If no events appear, verify the selected calendar and make sure the previous month has events. If counts look off, check event start and end dates and confirm they are all day entries when needed.
  12. Enable the workflow so the Cron schedule runs it on the first day of every month.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Calendar

Sign up

Free: $0; all Google Calendar API usage is at no additional cost; quota limits apply (no charges for overages).

Mailtrap

Sign up

Free: $0 / mo, 3,500 emails / mo via API/SMTP (150/day), 1 domain

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.