Skip to main content

Connector Management

Connectors are the data pipelines that feed external systems into GTM Clarity's canonical schema. The platform supports five connector types, each normalizing source data into a unified format for scoring.

Supported Connectors

ConnectorType KeyAuth MethodData Synced
SalesforcesalesforceOAuth 2.0 (Web Server Flow)Accounts, Contacts, Leads, Opportunities, Activities
Customer.iocustomerioAPI KeyPeople, Email events, Behavioral events
Delivr.aidelivraiAPI KeyIntent signals, Company enrichment
Office 365o365OAuth 2.0 (Microsoft Graph)Email metadata (privacy-first, no body content)
Fathom.videofathomAPI KeyMeeting transcripts, Participants, Sentiment
info

Each tenant can have at most one connector per type. This is enforced by a unique index on (tenant_id, type) in the connectors table.

Adding a Connector

Step 1: Navigate to Connector Settings

Go to Settings > Connectors and click Add Connector. Select the connector type you want to add.

Step 2: Authenticate

For OAuth-based connectors (Salesforce, O365):

  1. Click Connect to initiate the OAuth flow
  2. You will be redirected to the external service to authorize access
  3. After granting access, you are redirected back to GTM Clarity
  4. Tokens are encrypted with AES-256-GCM and stored securely

For API key-based connectors (Customer.io, Delivr.ai, Fathom):

  1. Enter your API key in the configuration form
  2. Click Verify to test the connection
  3. The key is encrypted before storage

Step 3: Configure Field Mappings

After authentication, review and customize the field mappings. Each connector provides sensible defaults, but you can override them. See Field Mapping Configuration for details.

Step 4: Set Sync Schedule

Syncs are orchestrated by Temporal workflows. The default schedule runs incremental syncs every 4 hours. Admins can:

  • Trigger a manual sync at any time
  • Configure the cron schedule per connector
  • Request a full sync (re-imports all data)

Connector Table Schema

The connectors table stores all connector instances:

ColumnTypeDescription
idtext (UUID)Primary key
tenant_idtextTenant scope
typetextConnector type (salesforce, customerio, delivrai, o365, fathom)
nametextDisplay name
configjsonbEncrypted configuration (tokens, keys, settings)
statustextdisconnected, connected, syncing, error
last_sync_attimestamptzTimestamp of last successful sync
last_sync_cursortextPagination cursor for incremental sync
last_sync_errortextError message from last failed sync
field_mappingsjsonbLegacy field mappings (see field_mappings table)

Token Encryption

All OAuth tokens and API keys are encrypted at rest using AES-256-GCM:

  • Encryption key is stored in the CONNECTOR_ENCRYPTION_KEY environment variable
  • The key must be a 32-byte hex string (64 hex characters)
  • Generate a key: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
  • Tokens are decrypted only at runtime when a sync or authentication is needed
  • Encrypted tokens are never logged or returned in API responses
warning

Never commit the CONNECTOR_ENCRYPTION_KEY to source control. If the key is lost, all stored tokens become unrecoverable and connectors must be re-authenticated.

Monitoring Sync Health

Sync Status Indicators

StatusMeaning
connectedConnector is authenticated and idle
syncingA sync workflow is currently running
errorThe last sync encountered an error
disconnectedConnector has not been authenticated

Sync Logs

Every sync operation is recorded in the sync_logs table:

ColumnTypeDescription
sync_typetextfull or incremental
statustextrunning, completed, failed
started_attimestamptzWhen the sync began
completed_attimestamptzWhen the sync finished
records_createdintegerNew records imported
records_updatedintegerExisting records updated
records_failedintegerRecords that failed to import
error_messagetextError details if failed

Troubleshooting

SymptomLikely CauseResolution
Status stuck on syncingTemporal workflow timed outCheck Temporal UI for failed workflows; trigger manual sync
error with auth messageToken expired or revokedRe-authenticate the connector via OAuth
Low record countsIncremental cursor staleTrigger a full sync to reset the cursor
Missing fieldsField mapping misconfiguredReview mappings in Field Mapping Configuration

Sync Workflow Architecture

The workflow includes a dead letter pattern -- if a batch fails to write after 3 retries, the failure is logged and the sync continues with the next batch.

O365 Special Configuration

The O365 connector has additional privacy controls stored in the o365_config table:

SettingDescription
dpa_accepted_atData Processing Agreement acceptance timestamp (sync blocked if null)
allowed_domainsDomain allowlist for email metadata extraction (empty = most restrictive)
tenant_o365_domainTenant's own domain (always excluded from ingestion)
tip

The O365 connector extracts metadata only (sender, recipient, timestamps) -- it never reads email body content. The DPA must be accepted before any sync can proceed.