Booking a meeting room is a small task that people do many times a week, usually in the middle of a conversation about the meeting itself. This page follows one booking from a slash command to a calendar event, and the three constraints that shaped it: Slack must be answered in three seconds, two bookings must not overlap, and a calendar that people trust has to agree with the database.
The commands
Two Slack apps share the code: one for meeting rooms, one for the broadcast studio. Each has three commands.
| Command | What it does |
|---|---|
| Book | Opens a modal with the booking form |
| My bookings | Sends the user their next ten bookings as a direct message, each with an edit and delete menu |
| Day schedule | Sends a timeline of one day, from 07:00 to 22:00, with the free gaps shown. Edit and delete menus appear only on the user’s own bookings |
The studio bot has the same three for live-broadcast slots, with crew roles in place of attendees.
Verifying that Slack sent it
A slash-command endpoint is a public URL. Anyone who finds it can post to it, so the first thing each route does is prove the request came from Slack.
Slack signs every request with a secret the app shares with it. The route reads the raw body as text before any parsing, builds the string Slack signed from a version tag, the request’s timestamp and that body, computes an HMAC-SHA256 with the signing secret, and compares the result with the signature header in constant time.
Two details matter.
- The raw body. The signature covers the exact bytes Slack sent. Parsing the form first and re-serialising it would produce a different string and a signature that never matches.
- The timestamp. A request whose timestamp is more than five minutes old is refused. Without that, a captured request could be replayed later with its valid signature.
There are two signing secrets, one per bot. The route tries each, and the one that verifies also decides which bot’s API client is used to answer.
From command to booking

The modal. The form asks for a title, a room, a date, start and end times in ten-minute steps, a recurrence, attendees picked from the Slack workspace, external guests typed as names, and when to remind. Two of the fields change the form: choosing “another place” reveals a text field, and choosing a recurrence reveals its end condition. Slack sends an action when either changes, and the route rebuilds the modal from its current state and updates it in place.
The submission. When the user submits, the route:
- Validates the times. An end that is not after the start is returned as an error that Slack shows inside the modal, so the user corrects it without losing the form.
- Finds the person. The Slack user’s profile email is matched to a oneFlow account. Each selected attendee is resolved the same way, and attendees with no account are still kept with their name and email.
- Expands the recurrence into dates.
- Checks for conflicts.
- Writes the booking and answers.
After the write. The Google Calendar event and the confirmation message are started once the booking is saved and are not awaited, so the response to Slack does not wait for them. A calendar API call can take longer than Slack will wait. If it is slow, the user still sees a saved booking, and the event appears a moment later.
Recurrence and conflicts

A recurring booking is turned into a list of dates before anything else happens. The generator supports six rules and stops at 52 occurrences whatever the end condition says, so a weekly meeting with no end date becomes one year of bookings and not an unbounded series.
Each date becomes its own document. The documents of one series share a group id and a copy of the rule. This is the data shape.
// one reservation (shape)
{
title,
location, // one of the fixed rooms, or free text
date, // "YYYY-MM-DD", Korean time
startTime, endTime, // "HH:mm"
createdBy: { userId, fullName, email },
participants: [{ userId, fullName, email }], // userId empty for people without an account
reminders: [10, 30], // minutes before
remindersSent: [], // keys of reminders already delivered
googleEventId, // set after the calendar event is created
recurrenceGroupId, // shared by the occurrences of one series
recurrenceRule: { type, intervalDays, customDays, endDate, occurrences }
}
The conflict rule is the standard interval overlap: two bookings in the same room on the same date clash when each starts before the other ends. For a series, the check is one query: the same room, any of the generated dates, and the overlap condition. If anything comes back, nothing is written, and the modal lists the first three clashes with a count of the rest. A series is accepted whole or not at all.
book(room, dates[], start, end):
clashes = reservations.find(
location = room
and date in dates
and startTime < end
and endTime > start )
if clashes: return errors to the modal (first three, "+N more")
insert one document per date, with a shared group id
respond 200
then, without waiting:
for each document: create the calendar event, store its id
send the confirmation message
Google Calendar
The tool writes to two shared calendars, one for rooms and one for the studio, through a service account.
| Booking | Calendar event |
|---|---|
| Title | Summary |
| Room | Location |
| Date, start and end | Start and end as local times with the Asia/Seoul time zone |
| Organiser’s name | Description |
| Attendees who have an email | Attendees, with display names |
The event id that Google returns is stored on the booking. An edit replaces the event by that id, and a delete removes it. Because every occurrence of a series is its own booking, every occurrence is also its own event.
Reminders
A booking carries the minutes-before values the user chose. A route designed to be called once a minute looks at today’s bookings, and for each reminder whose time has arrived it sends a direct message to every attendee it can find in Slack.
Sending once is handled with a key. Each reminder has a key made of its minutes, the booking’s date and its start time. Before sending, the route checks whether the key is in the booking’s list of sent reminders, and after sending it adds it. The send window is two minutes wide, so a run that is a little late still fires, and the key keeps the next run from firing again.
Editing a booking from Slack clears the list. Because the key includes the start time, a meeting moved to a new time gets fresh reminders, and the old ones cannot fire.
Failure modes
| What happens | What the system does |
|---|---|
| A request arrives with a wrong signature | Refused before any work is done |
| A valid request is replayed after five minutes | Refused by the timestamp check |
| The end time is not after the start | An error shown inside the modal |
| The Slack user has no matching account | An error shown inside the modal |
| One date of a series clashes | Nothing is written. The modal lists the clashes |
| The calendar call fails | The booking stays. The failure is logged and the booking has no event id |
| The reminder route runs twice in the same minute window | The key in the sent list stops the second message |
| Someone other than the creator tries to edit | Refused, with one super-admin exception in Slack |
Limits
- The conflict check is a query. It reads and then writes, and no database constraint backs it. A unique key on room, date and slot would make the rule structural.
- The calendar is a mirror with no repair. A failed calendar call is logged and not retried, so a booking can exist without an event. There is no job that reconciles the two.
- A series is a set of independent bookings. Editing one occurrence changes that occurrence. There is no “this and following” edit.
- Each occurrence is a separate calendar event. Google’s own recurrence rules are not used, so a year-long weekly series is 52 API calls in the background.
- This module has no automated tests. The tests in the repository cover permissions, the broadcast workflow and a recipient parser.
