Operational Visibility · Workforce Surface · Platform Anchor
Cadence™: Your Whole Operation, Visible
Practice Operations · Calendar-as-Surface Coordination · Principal Architect
- Python
- LionsHead Integration Library v2.6
- Three-layer handler/interpreter/config separation
- Two-layer dedupe (exact + fuzzy adopt)
- OAuth user flow + refresh-token persistence
- Token-bucket rate limiter
- Append-only audit log (fsync per write)
- BI-ready JSON-Lines pipeline trace
- Starter dashboard + SQL drop-in
Problem
Your system of record holds the truth. Appointments, callbacks, the schedule everything downstream depends on. But your team doesn't live inside the system of record during the working day. They live in their calendar. Whatever the system of record knows that the calendar doesn't is invisible to the people doing the work. They either keep two windows open and remember to cross-check, or they let things slip. When something slips, the relationship's trust degrades, the renewal probability falls, the case dies quietly. The naive fix is each person hand-copying entries onto their own calendar. That produces duplicates, drift, and forgotten records. The slightly less naive fix is to abandon the system of record's scheduling layer and let the calendar carry the truth, which works until compliance, audit, or recordkeeping needs those records and the disconnect costs you under review. Originally deployed against a dialer-centric insurance CRM. The same gap appears anywhere a calendar and a system of record live in separate places.
Architectural Solution
A continuous one-way sync that keeps the system of record authoritative and projects its truth onto the team's calendar within minutes. Built on the LionsHead Integration Library with a strict three-layer separation: handler interfaces speak workforce vocabulary only (employee_id, scheduled_at, is_complete, contact_phone), platform interpreters plus declarative configs handle each platform's wire conventions, and per-client config files supply the tenant pointers (calendar id, custom field projections, dedupe windows). The destination handler runs a two-layer dedupe pass on every record. An exact-marker lookup catches every event the bot has written before. A fuzzy adoption pass searches a configurable window around the scheduled time for events the user typed in by hand. When one matches, the bot patches it in place rather than creating a duplicate. State transitions are visual: a completed entry's event prefixes with [Done] and its colour mutes to graphite rather than disappearing. Three log streams keep operational, audit, and pipeline-trace concerns isolated. Operational logging answers 'is it running.' Audit logging is append-only with fsync per write and answers 'what did the bot do to this account.' The pipeline trace is JSON-Lines-per-day with pre-computed dimensional fields so BI tools ingest it without intermediate data engineering. A starter dashboard ships with the project and renders trailing-thirty-day totals in the terminal. A SQL file drops the same metrics into Tableau, Power BI, Looker Studio, Metabase, or Excel via Power Query.
Tangible Result
The team opens their calendar; the day is laid out. Each event title carries the client name and disposition, each location carries the dialable phone number, each description carries the notes left in the system of record the last time anyone touched the lead. Completed entries visually cross out in place rather than vanishing. Adopted manual entries stop generating duplicates after the first cycle. The compliance officer can reconstruct any individual event's lifecycle from the audit log. The principal can show a prospect or a renewal client a live dashboard of throughput against the trace stream, no manual data reconstruction required. The integration is not just a sync. It produces its own evidence of value as it operates, in a format the client's BI tools consume directly.
Same pattern, different surface
The same architecture translates wherever a system of record holds the truth and a calendar is where the working day actually happens. Different industries, same gap.
- Medical practice: appointment book + EHR scheduling system
- Law firm: matter calendar + case management software
- Investment advisor: client meetings + CRM
- Dental: operatory schedule + practice management software
Where it scales
Per-cycle workload for a typical book runs in roughly two seconds against approximately one source call and twenty destination calls. Transport is wrapped in a token-bucket rate limiter with classified error retry (rate-limit, auth, validation, transient) so cycles survive upstream hiccups without dropping records. Daily rollups land in a flat file BI tools ingest directly. High-cardinality identifiers are isolated from low-cardinality dimensional fields so trace queries stay fast as volume grows. A new tenant on the same platform pair is one client-config file. No library work, no platform interpreter changes.
Where it mutates
Replacing the source CRM (HubSpot, Salesforce, Pipedrive, Zoho, GoHighLevel, Close) is one handler module plus one platform config. Replacing the destination calendar (Outlook, iCloud, CalDAV) is the symmetric change. Handler code never references a platform-specific field name. The interpreter resolves abstract names against the config, so the orchestrator, the dedupe layer, the audit stream, and the dashboard all stay unchanged across platform swaps. Event templates, field mappings, dedupe window, and per-state styling are all declarative in the platform config. Extending to a new vertical (dental hygienist appointments, financial-advisor meetings) is one payload definition.
googleCalendarHandler.py
# Two-layer dedupe. Every record runs both paths.# 1. Exact-marker lookup catches every event written before.# 2. Fuzzy adoption catches events typed in by hand.# Patching adopts them by writing the marker. event_body = self._build_event(record)existing_id = self._find_event_id(marker) # exactadopted = False if not existing_id: existing_id = self._fuzzy_find_event_id(record) # adopt adopted = existing_id is not None if existing_id: self._service.events().patch( calendarId=self.calendar_id, eventId=existing_id, body=event_body, ).execute() self._audit.record("ADOPT" if adopted else "UPDATE", ...)else: inserted = self._service.events().insert( calendarId=self.calendar_id, body=event_body, ).execute() self._audit.record("CREATE", record_id=inserted["id"], ...)