ByteChef logo
ByteChef
tutorials

Automate Paid Time Off Requests with ByteChef

Automate Paid Time Off Requests with ByteChef
3 min read
Marija Horvat

Managing paid time off (PTO) requests is one of those processes that looks simple, but quickly becomes messy: emails, spreadsheets, calendars, approvals and follow‑ups. In this post, we’ll walk through a real‑world ByteChef workflow that automates the entire PTO request lifecycle - from Google Forms submission to calendar updates and Slack approvals.

Triggering a New Request

The workflow starts with a Google Forms trigger that captures the start date, end date, optional reason for leave and the respondent’s email address. Once a new response is submitted, ByteChef immediately kicks off the automation.

Google Forms returns dates as plain strings, so to ensure consistent handling across calendars and date helpers, the workflow uses a JavaScript task to normalize them. The start date is converted to a datetime with 00:00:00, while the end date is converted to a datetime with 23:59:59. At this stage, the first validation takes place. Using the Date Helper and a condition step, the workflow verifies that the end date is not earlier than the start date.

New Request

Identify the Employee

If the request is valid, the workflow continues by retrieving an employee directory from Google Sheets. This directory contains employee emails, full names and references to their personal PTO spreadsheets.

The workflow iterates through the list, matches the respondent’s email address and stores the corresponding employee name and PTO spreadsheet ID for use in later steps.

Get Employee Data

Calculate Used PTO Days

Next step is validating whether the employee has enough remaining vacation days. First, the workflow reads the number of remaining PTO days from a predefined row in the employee’s PTO spreadsheet. Then, using Google Calendar and JavaScript step, it calculates how many working days fall within the requested period by excluding weekends and public holidays. This is a second condition in the workflow where request can be automatically rejected.

Calculate Days

Create the Approval Message

If the employee has enough remaining PTO days, the workflow prepares an approval message for managers. The message includes the employee’s name, the requested date range, any overlapping PTO requests and the optional reason for leave. Managers can approve or reject the request directly from Slack.

Create Approval Message

Approving or Rejecting the Request

This is the final decision point in the workflow with two possible outcomes:

  1. Rejected: slack message gets a ❌ reaction and employee receives a rejection email.
  2. Approved: slack message gets a ✅ reaction and employee receives a confirmation email. The workflow automatically writes PTO entry to the employee’s Google Sheet and adds the approved leave to Google Calendar.
Approve/reject request

Conclusion

The PTO Elf workflow demonstrates how Bytechef can orchestrate complex, real‑world business processes in a clear and structured way. If you’re still managing PTO through email chains and manual spreadsheet edits, this is a great example of how automation can save time and ensure consistency.