Skip to content

feat: Google Workspace SDK integration — auto-detect interview invites from Gmail and sync to calendar + prep files #660

@Schlaflied

Description

@Schlaflied

Summary

Add official Google Workspace SDK integration (Gmail API + Google Calendar API) so career-ops can automatically detect interview invitations, update the tracker, create interview prep files, and add events to Google Calendar — without manual intervention.

Motivation

Current workflow requires manual steps:

  1. User notices interview confirmation email in Gmail
  2. User tells the AI agent manually ("company X replied, interview on date Y")
  3. Agent updates applications.md, creates prep file, adds calendar event separately

With Google SDK integration, steps 1–3 collapse into a single automated pipeline triggered by node scan-gmail.mjs.

Previous attempt using third-party scraping (Apify) was unreliable (rate limits, DoS protection). Google's official OAuth2 SDK is stable, already battle-tested with this project's googleapis npm package, and doesn't depend on any third-party infrastructure.

Proposed Implementation

Auth (already solved)

OAuth2 flow with local HTTP server on port 3000 — token persisted to calendar/token.json. The googleapis npm package is already a dependency. No new auth infrastructure needed.

scan-gmail.mjs (new or upgrade existing)

node scan-gmail.mjs
  1. Query Gmail for recent emails matching interview-related keywords:
    • subject:(interview OR prescreen OR "phone screen" OR "meet with" OR "calendar invite" OR "zoom invite" OR "teams meeting")
    • From last N days (configurable, default 7)
  2. For each match, extract:
    • Company name (sender domain / email body)
    • Role title
    • Date + time
    • Interviewer name / contact
    • Meeting link (Zoom/Teams/Google Meet)
  3. Output JSON for each detected interview

Downstream actions (per detected interview)

Action File
Update applications.md status → Interview merge-tracker.mjs or direct edit
Create/update interview prep file interview-prep/{company}-{role}.md
Add Google Calendar event existing calendar/add-event.mjs logic

Config additions (config/profile.yml)

google:
  credentials_path: calendar/credentials.json
  token_path: calendar/token.json
  gmail_scan_days: 7
  calendar_id: primary  # or specific calendar ID

.gitignore additions

calendar/credentials.json
calendar/token.json

What this is NOT

  • Not a full email client
  • Not reading email body content beyond what's needed for extraction
  • Not storing emails — scan only, no persistence beyond what's written to tracker/prep files

Related

  • Existing scan-gmail.mjs in some user forks (partial implementation)
  • Existing calendar/add-event.mjs (Calendar write already works)
  • scan.mjs pattern (zero-token, pure API, no LLM cost) — this should follow the same philosophy

Acceptance Criteria

  • node scan-gmail.mjs runs without requiring LLM (pure API calls)
  • Detects interview confirmation emails with >80% accuracy on common formats (Greenhouse, Workday, direct recruiter email)
  • Does not duplicate entries if run multiple times (dedup by company+role)
  • Auth flow documented in README
  • credentials.json and token.json in .gitignore
  • Works with both Gmail personal accounts and Google Workspace accounts

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin-candidateGood integration, lives outside core — candidate for the optional-integrations/plugin surface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions