Skip to main content
A ConnectorMapping row is the compiled JSONata expression that the connector sync pipeline uses to transform one MCP tool’s response payload into one of twelve Well financial-graph entity types (company, invoice, transaction, account, etc.). One row is produced per unique (workspace_connector, target_model, tool_name) triple; the triple is enforced by a partial unique index on non-deleted rows. The record is entirely pipeline-owned: it is created, regenerated, and soft-deleted by SyncConfigService during each MCP sync cycle, and is never written by a user. It is associated upward to a WorkspaceConnector (the authenticated provider instance) and to a Workspace.
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

Data model

Attributes

Relationships

System-computed

  • connector_mapping_id β€” generated via gen_random_uuid() at insert; unique constraint enforced at DB level
  • created_at β€” set once by MikroORM onCreate lifecycle hook
  • updated_at β€” set on every flush by MikroORM onUpdate lifecycle hook
  • deleted_at β€” soft-delete; when set, the row is excluded from the partial unique index on (workspace_connector_pk, target_model, tool_name) WHERE deleted_at IS NULL, allowing a fresh row to be inserted under the same triple
  • needs_regeneration β€” auto-flipped to true by SyncConfigService when schema drift (β€˜drift’ result from compareSchemaFingerprints) is detected or last_persist_count == 0 after a sync
  • last_persist_count β€” stamped by SyncConfigService.recordPersistCount after each sync completes; zero value is the signal for automatic re-generation on the next sync cycle
  • expression β€” produced by the structured slot-decision jury pipeline (3-panelist OpenAI strict json_schema β†’ reconcileJuryDecisions β†’ mergeSlotDecisions with YAML-pinned slots β†’ compileSlotDecisionsToJsonata); regenerated when needs_regeneration is true; subject to three-tier graceful degradation (reuse prior working expression β†’ legacy jury β†’ hard fail)
  • schema_fingerprint β€” computed from the provider tool schema sample at generation time; compareSchemaFingerprints returns identical | additive_only | drift; only β€˜drift’ triggers regeneration
  • schema_key_paths β€” extracted from the provider schema sample during jury generation; used for vocab-bound source_path validation by jury panelists
  • audit_trail β€” written by JuryService after each jury run; null on rows predating the structured pipeline
  • pagination_spec β€” discovered by the same schema-sample pass as the JSONata jury at generation time; null means single-page tool
  • tool_args β€” captured once at AI tool-selection time (selected_at anchor); never mutated post-creation; bounded to 64 KB by a CHECK constraint (Migration20260420100000)
  • Partial-unique index connector_mappings_wc_target_tool_unique on (workspace_connector_pk, target_model, tool_name) WHERE deleted_at IS NULL β€” enforces one active mapping per tool-per-target-per-connector; added in Migration20260420100000 replacing the legacy (workspace_connector_pk, target_model) unique index

Example

Source: /Users/maximechampoux/platform/apps/api/src/database/entities/ConnectorMapping.ts Β· domain: ingestion Β· tier: Infrastructure