Create leave calendar events and send approval emails
When an approver confirms a leave request, the leave lands on the team calendar, the requester gets an approval email, and their allowance is updated.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-leave-calendar-events-and-send-approval-emails/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Human Resources (HR) · HR operations
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-leave-calendar-events-and-send-approval-emails
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-leave-calendar-events-and-send-approval-emails/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-leave-calendar-events-and-send-approval-emails - 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 create-leave-calendar-events-and-send-approval-emails - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-leave-calendar-events-and-send-approval-emails
zaps/create-leave-calendar-events-and-send-approval-emails/
- 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 3 to fill in
- connections/gmail.tsThe
gmailaccount it uses - connections/google-calendar.tsThe
google-calendaraccount it uses - connections/zapier-tables.tsThe
zapier-tablesaccount it uses - triggers/button-click-record.tsWhat starts it:
zapier-tablesbutton_click_record - 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: an approver clicks the button on a leave request record in a Zapier Tables leave requests table (
zapier-tables,button_click_record). - Google Calendar creates the leave event on the chosen calendar, with the requester as an attendee. Full-day requests become all-day events; partial-day requests become timed events.
- Gmail sends the requester an approval email with the event's details, a link to the calendar event and how to change it.
- Zapier Tables finds the requester's row in the leave tracker by email (or creates one if there is none) and decrements its allowance by the leave taken: days for full-day requests, hours for partial-day requests.
If the request is missing its email, dates or (for partial days) times, the run stops and creates nothing.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
LEAVE_REQUESTS_TABLE_ID |
The Zapier Tables table of leave requests. The trigger is set to this table, and its button is what approvers click |
LEAVE_TRACKER_TABLE_ID |
The table with one row per requester: email in data__f1, name in data__f2, allowance in data__f3 |
CALENDAR_ID |
The Google Calendar that receives approved leave, as the calendar's email address |
Also review the defaults with them: a requester with no tracker row starts at 0 allowance (set in workflow.ts), so the first approval takes it negative unless they set a real starting balance first. EDIT_INSTRUCTIONS in workflow.ts is the line added to the approval email.
Confirm before building: which leave request fields hold the requester name, email, leave type, start and end dates, start and end times, and the full-day flag; and which time zone the leave times are in, since the calendar event uses the calendar's own time zone.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-leave-calendar-events-and-send-approval-emails, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-leave-calendar-events-and-send-approval-emails, 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
zapier-tables(the table set and the leave tracker),google-calendar(the calendar that receives the leave events) andgmail(sends the approval emails) to the user's connections. No app needs a connection beyond these three. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/button-click-record.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
Run it once as a draft test run (run_workflow_draft in Zapier MCP) before publishing. Use a leave request row you created for the test, and put that row's ID in record_id. Set f2 to an address you control, such as the connected Gmail account, so the approval email goes only there:
{
"record_id": "TEST_RECORD_ID",
"new": {
"data": {
"f1": "Test Requester",
"f2": "tester@example.com",
"f3": "Annual",
"f4": "2026-11-02T00:00:00.000Z",
"f5": "2026-11-02T00:00:00.000Z",
"f6": null,
"f7": null,
"f8": true
}
}
}
Check that the all-day event for 2 November appears on the chosen calendar with the requester as an attendee, that the approval email arrives with the event link, and that the tracker row for that address has its allowance reduced by 1. If run-status tools aren't available, check Google Calendar, Gmail and Zapier Tables directly. Then ask the user to delete the test calendar event, test email and test rows, or change them back if they were real data. Publish only after the test passes, and confirm the trigger is active.
Notes
- Full-day requests count inclusive days: a request from 2 to 4 November takes 3 days, and a single full day takes 1. Partial-day requests take their length in hours, from start time to end time, so a single partial day is counted in hours, not as 1 day.
- A requester with no tracker row gets one created at 0 allowance, then reduced. Set the starting allowance first if the tracker should begin at a real balance.
- Keep real table IDs, calendar IDs and email addresses out of committed files; anyone who can read the workflow source can see them.
- To extend it: post each approval to a Slack or Teams channel so managers see it, or choose the calendar by the requester's department or office instead of one fixed
CALENDAR_ID.