Google Calendar Free/Busy Auto-Responder
When an email arrives requesting a meeting, check Google Calendar availability and auto-reply with free time slots.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - Google Calendar Free Busy Auto-Responder is an automated cloud flow that watches a mailbox for incoming meeting-request emails, queries Google Calendar for upcoming busy time blocks, and replies to the sender with a formatted HTML schedule so they can pick a free slot.
The flow ships Off as a reference implementation. Turning it on requires only authorizing the Office 365 Outlook and Google Calendar connections and (optionally) tuning the four environment variables.
Use Case
When you publish a calendar booking link or accept meeting requests via email, the back-and-forth of "what time works for you?" creates inbox friction. This flow auto-acknowledges every meeting-request email with your live calendar so the sender can self-serve a free slot on the first round-trip — no scheduling tools, no shared availability page, no manual lookup.
The flow is ideal for teams that:
- Sales reps
- Customer success managers
- Founders running their own scheduling
- Anyone whose Google Calendar is the single source of truth for availability
Flow Architecture
When New Meeting Request Email Arrives
Outlook 365 / OnNewEmailV3Polls the Inbox every 5 minutes; fires on emails whose subject contains the configured trigger phrase.
Init varCalendarId
Initialize Variable (string)Loads the Google calendar identifier from the env var.
Init varLookaheadDays
Initialize Variable (integer)Loads the lookahead window from the env var (cast to int).
Init varTimeZone
Initialize Variable (string)Loads the display time zone from the env var.
Init varTimeMin
Initialize Variable (string)Computes the lower bound of the calendar query (utcNow(), ISO-8601).
Init varTimeMax
Initialize Variable (string)Computes the upper bound (addDays(utcNow(), varLookaheadDays), ISO-8601).
List Calendar Events
Google Calendar / ListEventsFetches all events between varTimeMin and varTimeMax for the configured calendar.
Init varBusyHtml
Initialize Variable (string)Empty accumulator string for the busy-slot HTML rows.
For Each Calendar Event
Foreach over body('List_Calendar_Events')?['items']For each event returned by ListEvents: appends a <tr> with the event subject, start, and end to varBusyHtml (handles all-day events via coalesce).
Compose Reply Body
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GoogleCalendarId | String | primary | Calendar identifier passed to ListEvents (use 'primary' for the connection's primary calendar, or the email/ID of any calendar the connection has access to). |
| flowlibs_AutoResponderTriggerSubject | String | meeting request | Substring matched against incoming email Subject by the OnNewEmailV3 subjectFilter parameter. |
| flowlibs_FreeBusyLookaheadDays | String | 7 | Number of days ahead of utcNow() to fetch events for (cast to int via @int(...) in the InitializeVariable). |
| flowlibs_AutoResponderTimeZone | String | Eastern Standard Time | Time zone label rendered in the reply body (the events themselves are returned by the connector in their own offset; the value is informational). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Office 365 Outlook | shared_office365 | OnNewEmailV3 (trigger) SendEmailV2 |
| Google Calendar | shared_googlecalendar | ListEvents |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Re-target the calendar
- Set flowlibs_GoogleCalendarId to any calendar ID the connected Google account can see (an email like team@yourcompany.com, a shared-calendar ID, or 'primary').
- Change the trigger phrase
- Update flowlibs_AutoResponderTriggerSubject to whatever subject substring should fire the auto-response (e.g. 'schedule a call', 'book time', '15 mins'). The OnNewEmailV3 subjectFilter parameter is bound to this env var via @parameters('flowlibs_AutoResponderTriggerSubject'), so the change takes effect on the next polling cycle.
- Widen / narrow the lookahead
- Change flowlibs_FreeBusyLookaheadDays to control how many days ahead are returned. Values are strings in the env var (Power Platform constraint) and cast to int at flow-runtime via @int(parameters('flowlibs_FreeBusyLookaheadDays')).
- Filter to working hours / business days
- Add a Filter Array action between List Calendar Events and Init varBusyHtml keyed off dayOfWeek(item()?['start']?['dateTime']) and formatDateTime(...,'HH') to drop weekends / nights from the rendered table.
- Switch from busy-times to true free-slots
- Replace the foreach with a range(0, varLookaheadDays) walker that builds candidate hour blocks and filters out any that overlap an event in body('List_Calendar_Events')?['items'].
- Move to a shared mailbox
- Replace the trigger with SharedMailboxOnNewEmailV2 and add a mailboxAddress parameter — the rest of the flow is unchanged because triggerOutputs()?['body/from'] and body/subject remain in the same shape.
- Send via Outlook.com instead of Office 365
- Swap the two Outlook actions for shared_outlook equivalents and re-author the trigger output references to PascalCase (body/From, body/Subject) per the connector's schema.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Trigger subjectFilter
Pulls the env-var value at trigger-config time so the polling job filters server-side.
EXPR.02Init varLookaheadDays
String env var to int variable.
EXPR.03Init varTimeMin
RFC-3339 / ISO-8601 with milliseconds for the Google Calendar API.
EXPR.04Init varTimeMax
Lookahead upper bound.
EXPR.05Append Busy Slot Row (start/end)
Handles both timed (dateTime) and all-day (date) events without throwing.
EXPR.06Send Reply Email — To
shared_office365 OnNewEmailV3 returns the sender as body/from (lowercase).
EXPR.07Send Reply Email — Subject
Standard reply prefix.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.