External connections#
This folder documents each external system the AutoResponder pipeline talks to: what it is for, how it is configured, reads vs writes, and how live, read-only, and dry-run modes differ.
Code entry points: orchestration and wiring live in src/auto_responder/main.py. Per-email work uses ContactLookup (lookups) and ActionEngine (determination-driven actions).
Pipeline order (typical run)#
- Ingest — Email repository:
SELECTfrom the central MSSQLemailstable (connection string chooses server/database). - Classify —
AutoResponseDetermination(LLM / rules; not a DB connection). - Resolve contact — Cupola, Hodor, Multipub, Salesforce (
ContactLookup), except in dry-run where lookup is skipped and a minimal stub contact is used. - Act — Cupola, Hodor, Multipub, Salesforce, SFMC (
ActionEngine), plus notifications and output CSV/JSON.
Active-only policy. Every automated write that changes a person's state is gated on an active CUPOLA row. No auto-add, no auto-reactivate, and email / title updates fall through to Human Review whenever the preferred CUPOLA row is missing or inactive.
Determination.OUT_OF_OFFICEis a first-class outcome that never writes to any external system — see the per-connector pages below.
Connection documents#
| Document | System | Protocol / style |
|---|---|---|
| email-repository.html | Central inbox store | MSSQL read-only (emails) |
| cupola.html | Org/person (IPv4 system of record) | MSSQL |
| hodor.html | Prospect / order-side (dmorders_thompson area) | MSSQL |
| multipub.html | Subscription validation | MSSQL (often via linked server / OPENQUERY) |
| salesforce.html | Salesforce CRM | REST (Contacts & Leads) |
| sfmc.html | Marketing Cloud suppression lists | REST (Data Extension upsert) |
| graph-outlook.html | Optional Outlook via Microsoft Graph | REST (not used by the default main.py path) |
| Tarun Multipub upload | Tarun Multipub upload microservice | FastAPI POST /multipub/upload (separate auto-responder-tarun-upload process) |
Operating modes#
| Mode | Configuration | Effect |
|---|---|---|
| Live | WRITE_OPERATIONS_ENABLED=true, MOCK_ALL_SERVICES_FOR_DEV=false | Real connectors; Cupola / Multipub / Salesforce may fall back to mocks if health checks fail. Hodor stays real but can be graceful-unavailable if SQL is not configured. SFMC uses a real client when credentials and health check succeed. |
| Simulation (no writes) | WRITE_OPERATIONS_ENABLED=false | Live reads for Cupola, Multipub, Salesforce (if initialized), and Hodor when configured. Writes go through ReadOnlyDatabaseWrapper (logged, not executed) for those DBs. SFMC uses MockSFMCClient. Notifier runs with dry_run=True. |
| Dev mock-all | MOCK_ALL_SERVICES_FOR_DEV=true | Mock Cupola, Multipub, Salesforce, SFMC; real HodorDatabase class (graceful-unavailable if unset). Email repository is mock by default; set dry_run_use_real_email_repository=true to use the real repository. Contact lookup is skipped; a minimal stub Contact is used so the rest of the pipeline can run. |
| Hodor manual | HODOR_AUTOMATIC_UPDATES=false | Hodor reads still run when SQL is configured; writes are not executed. The action engine emails a compiled list of intended Hodor changes to NOTIFICATION_EMAIL_VENU (or NOTIFICATION_EMAIL_VENU if unset). See hodor.html. Independent of WRITE_OPERATIONS_ENABLED. |
Annotation: Processing reports label connectors as mock or unavailable when applicable (see main.py and format_lookup_connector_labels).
Freshness: These pages are meant to track the code. Update them when main.py, connectors, or action_engine.py behavior changes.