Goal: Automatically detect when team members are traveling to Tempo's SF or NY offices and make it easy for people to meet in-person.
Approach: Detect flights on Google Calendar → Send Slack DM with confirmation buttons → Add confirmed visits to shared calendar + announce in channel.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Google Calendar │────▶│ Detection │────▶│ Slack Bot │
│ (flight events) │ │ Service │ │ (DM + buttons)│
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
┌──────────────────────────┤
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Shared Calendar │ │ #sf-office post │
│ (Office Visits) │ │ #ny-office post │
└─────────────────┘ └─────────────────┘
- User books flight to SF → airline auto-adds to their Google Calendar
- Detection service (daily cron) scans calendars for flight events
- Parses destination airport → determines target office
- Sends Slack DM:
✈️ Looks like you're flying to SF on Jan 28-30. Will you be at the Tempo office?[Yes, add me][No, personal trip][Don't ask again for this trip] - If confirmed:
- Adds event to shared "SF Office Visits" calendar
- Posts to #sf-office: "👋 @user will be in the SF office Jan 28-30"
| Component | Purpose | Build Effort |
|---|---|---|
| Calendar Scanner | Cron job reads team calendars, finds flight events | Medium |
| Flight Parser | Extracts destination airport from calendar event | Medium (brittle) |
| Slack Bot | Sends DM with interactive buttons, handles responses | Medium |
| Shared Calendar Writer | Adds confirmed visits to shared calendar | Low |
| User Mapping | Google email ↔ Slack user ID | Low |
| State Store | Tracks sent notifications to avoid duplicates | Low |
| Capability | Required | Access Status |
|---|---|---|
| Read user calendars (org-wide) | Yes | ❌ NOT CONFIGURED - No OAuth credentials |
| List events with search/filter | Yes | ❌ Blocked by above |
| Create events on shared calendar | Yes | ❌ Blocked by above |
What's needed:
- Google Workspace Admin to enable domain-wide delegation, OR
- Each user individually grants calendar read access to service account
- OAuth credentials configured at
~/.config/gsuite/credentials.json
API Docs: Calendar API Events.list
| Capability | Required | Access Status |
|---|---|---|
| Send DMs to users | Yes | |
| Interactive message buttons | Yes | ❌ NOT AVAILABLE - Current CLI has no button/interactivity support |
| Post to channels | Yes | ✅ Available via slack send |
| Map email to Slack user ID | Yes | ✅ Available via slack users |
What's needed for interactive buttons:
- Slack App with
chat:write,im:write,users:read.emailscopes - Interactivity enabled with Request URL endpoint
- Server to receive button click webhooks
Alternative without buttons: Send DM with instructions to reply "yes" or "no" - parse text responses instead. Less elegant but no webhook infrastructure needed.
| Capability | Required | Access Status |
|---|---|---|
| Create/push to repo | Yes | ✅ Authenticated as gakonst |
| Create gists | Yes | ✅ gist scope available |
Problem: Airlines format calendar events inconsistently:
UA 123: SFO → JFKFlight to San FranciscoTrip - New YorkConfirmation: American Airlines
Mitigations:
- Start with literal airport code matching (SFO, JFK, etc.) - highest confidence
- Build corpus of real flight events from team to tune parsing
- Accept lower recall initially; iterate based on missed detections
Problem: Need read access to everyone's calendar.
Options:
- Domain-wide delegation (requires Workspace Admin approval)
- Individual OAuth consent (each person must authorize once)
- Calendar sharing (each person shares calendar with service account)
Recommendation: Domain-wide delegation is cleanest but requires admin buy-in. Start with opt-in individual OAuth for pilot users.
Problem: Which airports map to which office?
| Office | Primary Airports | Edge Cases |
|---|---|---|
| SF | SFO, OAK, SJC | Sacramento (SMF)? Monterey? |
| NY | JFK, EWR, LGA | Hartford? Philly? |
Mitigation: Start conservative (primary airports only). The confirmation step lets users correct if we miss their airport.
| Scenario | Problem | Handling |
|---|---|---|
| Red-eye flights | Arrives 6am - which day in office? | Use arrival date |
| Multi-leg trips | SFO → ORD → JFK | Use final destination |
| One-way flights | Flying home, not visiting | Ask in confirmation |
| Already in city | Local employee flying out | Ignore outbound-only |
| Round-trip same day | Day trip | Include single day |
Problem: Frequent travelers get spammed; personal trips trigger unwanted DMs.
Mitigations:
- "Don't ask again for this trip" button
- Store declined trip IDs, don't re-notify
- Weekly digest option instead of per-flight
Create shared Google Calendars "SF Office Visits" and "NY Office Visits". Ask team to manually add events when visiting. Measure adoption after 2 weeks.
Build /visiting sf jan 28-30 Slack command that:
- Adds event to shared calendar
- Posts to #sf-office / #ny-office
Value: Removes friction of finding/opening calendar. Tests if people will use the system at all.
- Daily cron scans calendars (start with opt-in pilot users)
- Detect flights via airport code regex
- Send plain-text Slack DM asking for "yes/no" reply
- Parse replies, add to calendar
Requires: Google Calendar API access for pilot users
- Replace text replies with button interactions
- Requires webhook endpoint for Slack interactivity
-
Who is the Google Workspace Admin that can enable domain-wide delegation or approve OAuth scopes?
-
Shared calendar ownership - Should this be a team calendar or resource calendar?
-
Channel preferences - Are #sf-office and #ny-office the right channels, or should we create dedicated #office-visits?
-
Pilot users - Who are 3-5 frequent travelers willing to test with their calendars?
- ✅ Spec complete (this document)
- ⏳ Get Google Workspace Admin approval for Calendar API access
- ⏳ Create shared calendars for SF/NY office visits
- ⏳ Build Phase 1 slash command as MVP
- ⏳ Recruit pilot users for Phase 2 testing