Rotate on-call schedules around leave and holidays with Google Calendar, Slack and Nager.Date

Go to Workflow
0 views
Built by Melbin Francis Melbin Francis
Created on September 29, 2026

Description

Quick overview
This workflow rotates weekly on-call duty using Google Calendar events, factoring in team history, leave, and public holidays from the Nager.Date API, then announces the assignment and swap outcomes in Slack and updates a channel topic at handover time.

How it works
Runs every Thursday at 10:00 and also triggers when an on-call Google Calendar event is updated.
Reads past on-call events and upcoming leave events from Google Calendar and fetches the next public holidays from the Nager.Date API.
Calculates the target on-call week and selects the fairest available person based on recent on-call history, required rest weeks, leave events, and region-specific public holidays.
If it is the weekly run and no on-call event exists yet, creates an all-day on-call event in Google Calendar and posts the assignment to a Slack channel.
Waits until the configured handover time and then updates the Slack channel topic to reflect the current on-call person.
If an on-call event edit looks like a swap, validates the new assignee against the same rules and sends them an approval request in Slack.
If the swap is approved, updates the Google Calendar event marker and posts a confirmation to Slack, otherwise reverts the Google Calendar event and posts the reason to Slack.

Setup
Add Google Calendar OAuth2 credentials and select the on-call calendar and leave calendar in the Google Calendar nodes (including the “On-Call Week Edited” trigger).
Add Slack OAuth2 credentials and set the target Slack channel in the message and channel-topic nodes.
In the Rota Rules node, define your team as Name; region; Slack member ID, set your holiday country code (for Nager.Date), and optionally set a lead Slack member ID for escalation messages.
Ensure leave events in the leave calendar include the person’s name in the event title so the workflow can match leave correctly.
Adjust fairness_weeks, rest_weeks, handover_time, and swap_answer_hours in Rota Rules to match your rotation policy and response expectations.

Requirements
A Google account with Google Calendar
A Slack workspace, and each team member's Slack member ID
Two calendars: one for on-call weeks, one for leave

Customization
Change how many weeks count for fairness, and the rest weeks between turns
Change the handover time and how long people have to answer a swap
Use a different country for public holidays
Change the event title if your team calls it something other than "On call"

Additional info
In plain words: someone on the team has to carry the pager each week, and working out who is fair, free and not on holiday is a weekly chore that is easy to get wrong. This workflow does it from your calendars. People swap simply by editing the on-call event; the workflow checks the swap, asks the new person in Slack, and puts the week back if they say no or the swap breaks the rules.

Example: Alex had last week, Robin is on holiday on Tuesday. The workflow books Sam for next week, posts it in Slack and changes the channel topic on Monday morning.

Leave counts for a person when the leave event's title contains their name, for example "Robin holiday".

Nodes Used (4)

Code
n8n-nodes-base.code
Google Calendar
n8n-nodes-base.googleCalendar
HTTP Request
n8n-nodes-base.httpRequest
Slack
n8n-nodes-base.slack