Skip to main content
DocumentWorkspaceConnector is a junction table that records the relationship between a Document and the WorkspaceConnector responsible for ingesting or distributing it. Each row captures which connector handled a given document, in which direction (input = ingested from a source, output = routed to a destination), and when the link was created. It is the provenance ledger for the document sync pipeline: every document that enters or leaves Well through a connector has at least one DWC row, and the table is the primary surface queried during sync-status range checks (filtered by workspace_connector_pk + created_at BETWEEN). The entity carries no public UUID key β€” it is an internal infrastructure join record, not a user-facing resource.
NamingValue
ObjectDocumentWorkspaceConnector
Resource type (JSON:API type)document_workspace_connector
Collection / records rootβ€” (not a records root)
REST base/v1/document-workspace-connectors
Entity classDocumentWorkspaceConnector
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

OperationMethod & pathStatus
ListGET /v1/document-workspace-connectors🟑 Planned
RetrieveGET /v1/document-workspace-connectors/{id}🟑 Planned
CreatePOST /v1/document-workspace-connectors🟑 Planned
UpdatePATCH /v1/document-workspace-connectors/{id}🟑 Planned
DeleteDELETE /v1/document-workspace-connectors/{id}🟑 Planned

Data model

Attributes

FieldTypeRequiredConstraintsAllowed valuesDescription
directionstring (native enum: direction_enum)βœ… YesNOT NULL; stored as PostgreSQL native enum core_api.direction_enum’input’ | β€˜output’Flow direction of the document through the connector. β€˜input’ means the connector ingested the document into Well (source connector). β€˜output’ means Well routed the document outward through the connector (destination connector).
created_atπŸ”’ system β€” timestamptzβœ… YesNOT NULL; set by onCreate: () => new Date()β€”Timestamp when the DWC link was created. Set once via onCreate hook; also set explicitly by DocumentWorkspaceConnectorService. Used as the right-hand operand in sync-status range queries (indexed via idx_dwc_wc_created_at and idx_dwc_input_active_doc_created).
updated_atπŸ”’ system β€” timestamptzβšͺ NoNULLABLEβ€”Timestamp of the last mutation. Set by onCreate and onUpdate hooks; also set explicitly by the service methods.
deleted_atπŸ”’ system β€” timestamptzβšͺ NoNULLABLEβ€”Soft-delete timestamp. NULL means the link is active. Set by application code; never populated by the normal create/stage paths.

Relationships

NameTypeRequiredDescription
documentto-one (ManyToOne)βœ… YesThe Document this connector link is associated with. Foreign key references core_api.documents(pk) ON UPDATE CASCADE. Indexed as the leading column of idx_dwc_input_active_doc_created (document_pk, created_at) for document-first access patterns.
workspaceConnectorto-one (ManyToOne)βœ… YesThe WorkspaceConnector (activated connector instance for a workspace) that ingested or distributed this document. Foreign key references core_api.workspace_connectors(pk) ON UPDATE CASCADE. Indexed as the leading column of idx_dwc_wc_created_at (workspace_connector_pk, created_at) for sync-status range queries.

System-computed

  • created_at β€” set once by onCreate: () => new Date(); also set explicitly to new Date() by DocumentWorkspaceConnectorService.createDocumentWorkspaceConnector() and .stage()
  • updated_at β€” set by onCreate and onUpdate hooks; also set explicitly by the service methods
  • deleted_at β€” soft-delete sentinel; NULL on creation; not written by the pipeline’s normal create/stage paths
  • pk β€” auto-increment serial primary key assigned by Postgres; internal join target only, never exposed in the public API
  • No public UUID (*_id) column β€” this is a pure infrastructure junction record with no user-facing stable identifier beyond pk

Example

{
  "data": {
    "type": "document_workspace_connector",
    "attributes": {
      "direction": "input",
      "created_at": "2026-01-15T09:23:11.000Z",
      "updated_at": "2026-01-15T09:23:11.000Z",
      "deleted_at": null
    },
    "relationships": {
      "document": {
        "data": { "type": "document", "id": "e3f1a2b4-cc90-4d5e-b8f7-123456789abc" }
      },
      "workspace_connector": {
        "data": { "type": "workspace_connector", "id": "a9b2c3d4-1111-2222-3333-abcdef012345" }
      }
    }
  }
}
Source: apps/api/src/database/entities/DocumentWorkspaceConnector.ts Β· domain: ingestion Β· tier: Infrastructure