All jobs

How Many Meeting Room Hours Did Each Member Company Use This Month? A Coworking Space's Month-End Count From Google Calendar

A coworking space's agent reads each meeting room's Google calendar at month end, totals hours per member company and drafts the overage lines for invoices.

Run this on RushOpens the console with this prompt ready to send. Connect Google Calendar there first.

What the agent does

This is for a coworking and flexible office operator with two or three buildings: hot desks, private offices for small companies, and a dozen bookable meeting rooms and a podcast booth. Each membership includes some meeting room hours a month (say 4 for a hot desk, 10 for a four-person office), and hours past that are billed on the next invoice. Every room is its own Google calendar, shared with the community team's account, and members book by inviting the room or through the front desk. At month end someone opens each room's calendar, adds up the bookings by company, and usually gives up and bills nobody. An agent does the count.

The community manager connects Google Calendar once with POST /me/connections {"type": "app", "name": "google-calendar"} and signs in with the account the room calendars are shared with. Rush's Google Calendar sign-in asks for calendar.readonly and calendar.events, and the run reaches the Google Calendar REST API through it, so the prompt tells the agent to read only: it never creates, moves or deletes an event.

On a run the agent calls calendarList.list to find the room calendars by the prefix in their names, then events.list on each with timeMin and timeMax for the month, singleEvents set to true so a weekly recurring stand-up comes back as each of its occurrences, and orderBy startTime. It skips events whose status is cancelled. Each booking is matched to a member company by the email domain of its organizer or creator, and when that is the front desk's own address, by the domains of its attendees. The member list in the prompt maps each domain to a company and its included hours. A booking it cannot match goes in a separate list rather than being guessed.

The agent adds up each company's booked hours, rounding each booking to the quarter hour, and subtracts the included hours. When two bookings on the same room overlap, it lists both and counts only the hours the room was actually held, so a double booking is not billed twice. It writes the totals as a CSV, and for each company over its allowance, one invoice line with the hours and the dates of the bookings that used them.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Month-end meeting room count for November 2026, time zone America/Toronto. Read only: never create, edit or delete an event. Members, as domain, company, included hours: brightledger.example, Bright Ledger, 10; northhollow.example, North Hollow Studio, 4; tidewater.example, Tidewater Analytics, 10; kestrel.example, Kestrel Legal, 6. Front desk address: frontdesk@ourspace.example. 1) calendarList.list; room calendars are those whose summary starts with 'Room - ' or is 'Podcast booth'. 2) For each, events.list with timeMin 2026-11-01T00:00:00-04:00, timeMax 2026-12-01T00:00:00-05:00, singleEvents true, orderBy startTime; skip status cancelled and all-day events. 3) Company = domain of organizer, else creator; if that is the front desk, the first attendee domain that is a member. Unmatched bookings go to a separate list. 4) Round each booking to the nearest 15 minutes. Where two bookings on one room overlap, count the overlapping time once and list both. 5) Write rooms.csv: company, bookings, hours booked, included hours, hours over. Write invoice-lines.md: for each company over its allowance, one line 'Meeting room hours over allowance, November 2026: N h' and the dates and rooms of its bookings. 6) List unmatched bookings and overlapping bookings separately with room, start, end, organizer.",
  "connections": [
    "google-calendar"
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is two files among the session's files: rooms.csv, one row per member company with bookings, hours booked, included hours and hours over, and invoice-lines.md, a drafted line for each company over its allowance with the bookings behind it. The session's result also lists bookings the agent could not match to a member and any bookings that overlapped on the same room.

What the community manager checks before billing: the unmatched list, which is usually a member booking from a personal address, and the overlaps, which may be a real double booking or a meeting moved without the old event being deleted. A member who disputes a charge can be shown the dates and rooms on their line. The invoice lines go into the billing system only after that check; the agent sends nothing to members.

Run it on every month end

In the console, a Project automation with a schedule trigger, cron 0 7 1 * * and timezone America/Toronto, runs a saved agent whose connections name google-calendar on the first of each month. The saved prompt says "last month" instead of naming November, and the member list is kept in the agent's instructions, which the community manager edits when a company joins or leaves.

In the middle of a month, a member asking how many hours they have left can be answered by starting the same saved agent from the console with that one company and "this month so far".

The use case this job follows, with its automation and trigger: Produce a report or file, no repo.

Why run it on Rush?

The Google sign-in stays in Rush's connection, and Rush signs the agent's Calendar requests outside its computer with a token limited to Calendar, so the agent never holds a Google password or a refresh token. Each run has its own computer and a record of every calendar it read, so when a member questions their overage, the run shows the exact bookings counted.

A spreadsheet formula cannot tell a front-desk booking from a member's, notice a double booking, or skip a cancelled meeting that still sits on a calendar export. The month-end run is recorded with its cost, and the same agent can count several buildings' rooms at once.

Frequently asked questions

Our rooms are Google Workspace resources, not shared calendars. Does that work?

A room resource has its own calendar address, and if it is in the connected account's calendar list, events.list reads it the same way. Add each room's calendar to the community team's account once and the agent finds it by name.

Why round to the quarter hour?

Members book 25 or 50 minutes as often as full hours. Rounding each booking makes the totals match what the membership agreement says, and the prompt can use a different rule if yours bills by the half hour.

Can the agent add the charges to our invoices?

It drafts the lines and stops there. Billing a member is something a person approves, especially for a company that may have been given extra hours by the community manager.

More Google Calendar jobs

More jobs like this: Produce a report or file, no repo

Keep reading