Add pre-built pre-meeting brief and CRM update automations

Draft
CO
2d ago
+4771-276

Summary

Context: GPUI automations only ran after meetings ended or summaries finished (note_enhanced / meeting_completed), and api-crm only exposed contact search without deal/note context or note writeback. Held as draft until the 1.4.36 bridge and GPUI 2.0.0 release train lands on main (targeted for 2.0.1).

Intention: Add pre-built GPUI automations and CRM API endpoints to generate pre-meeting briefs before calls begin and log post-meeting summaries and action items back to matched CRM contacts and deals.

Direction:

  • Added POST /crm/contact-context and POST /crm/log-note across HubSpot, Attio, Salesforce, Pipedrive, and Close in crates/api-crm, mapping provider auth failures to 424 reconnect_required via NangoConnectionState::mark_reconnect_required and regenerating apps/api/openapi.gen.json and packages/api-client.
  • Added the BeforeMeeting trigger, PreMeetingBrief / CrmUpdate starter automations and workflow steps in GPUI (apps/desktop-gpui/src/workspace/automations), CRM context enrichment & safe empty-memo brief saving (open_note/brief.rs), and the BriefScheduler / brief_tick loop (meeting/schedule/brief_schedule.rs, application/meeting_schedule.rs).
  • Operational notes: CRM writeback (POST /crm/log-note) requires CRM write scopes enabled in Nango Dashboard for HubSpot, Attio, Salesforce, and Pipedrive (read-only connections return 424 reconnect_required and surface a reconnect prompt). close is implemented end-to-end in api-crm and GPUI, but is not yet configured as a Nango integration in production.

Demo

N/A: verified via Rust unit and local runtime/wiremock integration tests; held as draft pending GPUI 2.0.0 release cutover.

Verification

  • cargo test --locked -p api-crm -p api-nango -p api-calendar: passed (api-calendar 1/1, api-crm 19/19, api-nango 29/29)
  • cargo clippy --locked -p api-crm --all-targets --no-deps -- -D warnings: passed
  • cargo test --locked -p api gen_openapi_json and pnpm -F @anlg/api-client typecheck: passed
  • apps/desktop-gpui: cargo clippy --locked --workspace --all-targets --no-deps -- -D warnings passed; cargo fmt --check and dprint check passed; lib tests passed (automations 6/6, brief 11/11, crm_update 1/1, brief_schedule 2/2, persistence_tests::automation 1/1 — linked locally on Xcode 27 / Swift 6.4 using -L native flags pointing at target/debug/build/*/out/swift-rs/*/out/Products/Debug)
  • ci.yaml scripts: test_check_license_boundary.py (9 tests OK), check_license_boundary.py, changelog/version checks passed; node --test passed 101/103 with 2 macOS host-only failures (spawnSync pwsh ENOENT) in scripts/desktop-release-provenance.test.mjs

Summary by cubic

Adds two pre-built GPUI automations — a pre-meeting brief generated before calls begin and a post-meeting CRM update — so meeting summaries and action items can be written back to matched CRM contacts and deals. Previously automations only ran on note_enhanced or meeting_completed events.

api-crm gains POST /crm/contact-context and POST /crm/log-note for HubSpot, Attio, Salesforce, Pipedrive, and Close, with the OpenAPI spec and API client regenerated. GPUI adds the BeforeMeeting trigger, starter workflows, CRM context enrichment for briefs, and a scheduler that prepares briefs before upcoming meetings. Provider auth failures now map to 424 reconnect_required and mark the connection for reconnection.

Operational notes

  • Logging notes back requires CRM write scopes in the Nango Dashboard for HubSpot, Attio, Salesforce, and Pipedrive; read-only connections receive a reconnect prompt.
  • Close is implemented end-to-end but is not yet configured as a Nango integration in production.