Update on-call contact group when rotation event starts
When an on-call rotation event starts on your calendar, the rotation is identified and handed to your routing workflow with the handoff time and default contacts, so the on-call contact group follows the active rotation.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/update-on-call-contact-group-when-rotation-event-starts/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Engineering operations
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/update-on-call-contact-group-when-rotation-event-starts
Set it up with the CLI
- Add it. Copies the folder into
zaps/update-on-call-contact-group-when-rotation-event-starts/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/update-on-call-contact-group-when-rotation-event-starts - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy update-on-call-contact-group-when-rotation-event-starts - Check it. Its recent runs, with status and errors.
npx zap-pack logs update-on-call-contact-group-when-rotation-event-starts
zaps/update-on-call-contact-group-when-rotation-event-starts/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 2 to fill in
- connections/google-calendar.tsThe
google-calendaraccount it uses - triggers/event-start.tsWhat starts it:
google-calendarevent_start1 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: Google Calendar event start (
google-calendar,event_start). It fires a set time (15 minutes by default) before an event on the on-call calendar starts. The trigger record already carries the event details (title, start, attendees), so there is no separate "get event" step. - Normalize (plain code): the event title is lowercased, and
[tags],(notes), "Week N" and filler words (on-call, rotation, shift, handoff) are stripped, then it is kebab-cased."[install-test] Platform Primary On-Call (Week 44)"becomesplatform-primary. If the result is inKNOWN_ROTATIONS, it is the rotation; otherwiseFALLBACK_ROTATIONis sent withrotation_matched: false. - Webhooks by Zapier (Custom Request, POST JSON) calls the routing workflow's catch hook with
rotation_id,rotation_matched,raw_summary,effective_at(event start),group_membersandfallback_contacts(bothDEFAULT_CONTACTS),attendees(when present),event_idandevent_link.
Ask the user
Each REPLACE_… value is set per person. Resolve calendar names to IDs with the user's own Google Calendar connection; don't ask them to paste an ID you can look up.
| Setting | Where | What goes there |
|---|---|---|
REPLACE_ON_CALL_CALENDAR_ID |
triggers/event-start.ts, calendarid |
The calendar that holds the on-call rotation events |
REPLACE_ROUTING_WEBHOOK_URL |
config.ts, ROUTING_WEBHOOK_URL |
The catch-hook URL of the routing workflow that updates the contact group |
REPLACE_DEFAULT_CONTACT_EMAIL |
config.ts, DEFAULT_CONTACTS |
Each email address in the default contact set, one entry per person |
The routing workflow must exist before the Zap is tested. It needs a Webhooks catch-hook trigger, because it receives this payload and changes group membership.
Also review the defaults with them: KNOWN_ROTATIONS in workflow.ts (the rotation IDs, in lowercase kebab-case, from the names as they appear in event titles), FALLBACK_ROTATION in config.ts ("default"), and the 15-minute trigger time in triggers/event-start.ts. Is 15 minutes before the start acceptable, or should it be closer to the start? The trigger can't fire at exactly the start time.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/update-on-call-contact-group-when-rotation-event-starts, replace each REPLACE_… value as this file says, then run npx zap-pack deploy update-on-call-contact-group-when-rotation-event-starts, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
google-calendar(the account that can see the on-call calendar) to the user's connection for the trigger.workflow.tsuses no connection alias, and Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/event-start.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Point ROUTING_WEBHOOK_URL at an echo endpoint or a test catch hook first, so the test changes no real group. Then run this sample as a draft test:
{
"kind": "calendar#event",
"id": "EVENT_ID",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=EVENT_EID",
"summary": "[install-test] Platform Primary On-Call (Week 44)",
"start": {
"dateTime": "2026-10-30T09:00:00-04:00",
"timeZone": "America/New_York"
},
"end": {
"dateTime": "2026-10-30T10:00:00-04:00",
"timeZone": "America/New_York"
},
"attendees": [{ "email": "you@example.com", "responseStatus": "accepted" }],
"attendee_emails": "you@example.com"
}
Check that the run output shows rotation: "platform-primary", matched: true, and effectiveAt equal to the event start, and that the receiving endpoint got the same payload. For the fallback path, change the summary to something unknown and expect rotation: "default", matched: false. If run-status tools aren't available, check the result at the test endpoint directly. Then publish, confirm the trigger is active, and confirm the enabled state the user wants. The user deletes any test data, not the agent.
Notes
- Keyword filter: to run only for events with a rotation tag or keyword, set the trigger's
search_term, or add an early return when the summary lacks the tag. - Attendee-based mapping: for ad-hoc swaps, use the event's attendees as
group_membersinstead of the defaults when the event is marked as a swap. - Event start fires before the event, not at the exact start.
effective_atis still the real start time, so the routing workflow can schedule the change or apply it right away. - The trigger record's
attendeesis often absent. The code falls back to the comma-separatedattendee_emailsfield and sends an empty list when neither is set. All-day events havestart.dateinstead ofstart.dateTime; the code uses whichever is present. - Never commit a real webhook URL. Anyone with it can change your on-call group.