---
id: CAP-PFM-DJE-015
title: Reconcile loaded records using the producer’s keys
feature: FEAT-PFM-DJE-04
product_area: platform
module: data-job-engine
revision: 2
status: draft
product_intent: confirmed
implementation_evidence: observed
supersedes: []
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-platform:docs/milestones/plans/PLAT-M19-plan.md#S24'
purpose: >-
  A migration tool or integration compares current Rhythm records with its
  source extract using the identities assigned by the producing system.
outcomes:
  - Known producer keys return current record representations.
  - Unresolved keys are reported explicitly.
  - Reconciliation remains available during workspace loading.
concepts:
  - CON-PFM-DJE-004
actors:
  - ACT-PFM-037
  - ACT-PFM-036
surfaces:
  - api
preconditions: []
postconditions: []
permissions:
  - key: crm.contacts.bulk
    where_checked: api
    scope: tenant
  - key: crm.organizations.bulk
    where_checked: api
    scope: tenant
  - key: crm.contact-types.bulk
    where_checked: api
    scope: tenant
  - key: crm.regions.bulk
    where_checked: api
    scope: tenant
  - key: platform.custom-fields.bulk
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-PFM-DJE-015-01
    proved_by: [ATS-PFM-DJE-012-16, ATS-PFM-DJE-015-01, ATS-PFM-DJE-015-06, ATS-PFM-DJE-015-07, ATS-PFM-DJE-016-16, TST-PFM-DJE-129, TST-PFM-DJE-171]
    statement: >-
      A resolved producer key returns its record identity and ordinary-read
      representation, including owned details and custom fields, with results
      ordered by the requested keys.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/records-by-source-key.integration.spec.js#answers
      each record exactly as the ordinary read of one contact does
    origin: 'services-platform:docs/milestones/plans/PLAT-M19-plan.md#S24'
  - id: BR-CAP-PFM-DJE-015-02
    proved_by: [ATS-PFM-DJE-015-02, ATS-PFM-DJE-015-07, ATS-PFM-DJE-015-08, ATS-PFM-DJE-016-16, ATS-PFM-DJE-017-08, TST-PFM-DJE-075, TST-PFM-DJE-129]
    statement: >-
      An unknown key or a key whose mapped record is unavailable appears in the
      missing list, and repeated keys produce only one result.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-crm:modules/data-jobs/services/jobs/records-by-source-key.ts:readRecordsBySourceKey;
      services-platform:modules/data-jobs/services/jobs/records-by-source-key.ts:readCustomFieldsBySourceKey
    origin: 'services-platform:docs/milestones/plans/PLAT-M19-plan.md#S24'
  - id: BR-CAP-PFM-DJE-015-03
    proved_by: [ATS-PFM-DJE-015-03, TST-PFM-DJE-129]
    statement: >-
      A lookup accepts at most one hundred keys and rejects an oversized request
      with the limit identified.
    kind: validation
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/records-by-source-key.integration.spec.js#refuses
      more than 100 keys by InvalidRequest, naming the limit
    origin: none
  - id: BR-CAP-PFM-DJE-015-04
    proved_by: [ATS-PFM-DJE-015-04, TST-PFM-DJE-111]
    statement: >-
      Lookup routes remain available during loading and require the authority
      needed to read jobs of the same record kind; ordinary record-reading
      authority alone is insufficient.
    kind: permission
    enforced_at:
      - api
    must_prove: true
    provenance: documented
    source: 'services-crm:docs/data-jobs.md#Reading a load back by source key'
    origin: 'services-platform:docs/milestones/plans/PLAT-M19-plan.md#S24'
  - id: BR-CAP-PFM-DJE-015-05
    proved_by: [ATS-PFM-DJE-015-05, ATS-PFM-DJE-015-08, ATS-PFM-DJE-017-08, TST-PFM-DJE-129]
    statement: >-
      Lookup resolves keys within the requested record kind and workspace,
      without returning another workspace’s records.
    kind: invariant
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/records-by-source-key.integration.spec.js#looks
      a key up under its own object type only: a contact key is not an
      organization
    origin: 'services-platform:docs/milestones/plans/PLAT-M19-plan.md#S11'
  - id: BR-CAP-PFM-DJE-015-06
    proved_by: [ATS-PFM-DJE-012-16, ATS-PFM-DJE-015-06]
    statement: >-
      Producer-key lookup does not alter records and returns their current saved
      values, including changes made after import.
    kind: invariant
    enforced_at:
      - service
    must_prove: false
    provenance: observed
    source: 'services-crm:modules/data-jobs/services/jobs/records-by-source-key.ts'
    origin: none
  - id: BR-CAP-PFM-DJE-015-07
    proved_by: []
    statement: >-
      CRM provides lookups for contacts, organizations, five configuration
      catalogues, regions, activity types and activities; Platform provides a
      custom-field definition lookup, while custom records and associations have
      no corresponding route.
    kind: policy
    enforced_at:
      - api
    must_prove: false
    provenance: observed
    source: >-
      services-crm:modules/data-jobs/aws/api/bulk-data-jobs.routes.ts:BULK_SUBMISSIONS;
      services-platform:modules/data-jobs/aws/api/custom-field-data-jobs.routes.ts
    origin: none
scenarios:
  - id: SC-CAP-PFM-DJE-015-01
    given: >-
      A loading workspace contains two imported contacts and an imported
      organization.
    when: >-
      Reconciliation requests their producer keys together with a key that was
      never loaded.
    then: >-
      Known keys return ordinary-read record representations in request order,
      and the unknown key appears as missing.
    provenance: test
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/records-by-source-key.integration.spec.js#reports
      the key nothing loaded as missing
edge_cases: []
constraints: []
depends_on: []
related:
  - CAP-PFM-DJE-012
  - CAP-PFM-DJE-016
journeys:
  - JNY-PFM-DJE-004
  - JNY-PFM-DJE-005
open_questions: []
evidence:
  - >-
    services-crm: inspected producer-key route factories and schemas, lookup
    services, the ordinary-read comparison integration suite and the
    loading-workspace API suite.
  - >-
    services-platform: inspected the custom-field lookup service, its route and
    the definition reconciliation integration suite.
  - >-
    react-console: inspected the API reconciliation journey, including key
    trimming, missing records and access refusals.
controls: [TC-AVL-001, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, TC-CHG-007, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-CRY-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-006, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-003, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
exercised_by: [FAS-PFM-DJE-04-01, FAS-PFM-DJE-04-02, FAS-PFM-DJE-04-03, FAS-PFM-DJE-04-04, FAS-PFM-DJE-04-05]
suites: [TST-PFM-DJE-075, TST-PFM-DJE-111, TST-PFM-DJE-129, TST-PFM-DJE-171]
---

# Reconcile loaded records using the producer’s keys

## Purpose

Migration staff and integration clients can compare the source extract with the records currently saved in Rhythm. Producer keys let them perform that comparison without first collecting Rhythm’s internal identities.

## How It Works

The client identifies its source system and requests a bounded set of keys for a supported record kind. Rhythm resolves those keys through the workspace’s mapping records. It then reads the matched records through the same batched services used by their ordinary record reads. Results include the record identity and current representation, with missing keys listed separately. Repeating a key does not duplicate its result. A missing result can mean the key never loaded or that its mapped record no longer exists. The lookup remains available while the workspace is loading, under the same authority as that kind of data job. It performs reconciliation without changing the records. Ordinary edits can change a later answer, so this is a current read rather than a retained import snapshot. Platform’s custom records and associations still lack this reconciliation surface.

## Relationships

- Keyed imports establish the mappings used to locate current records.
- Migration package loading uses these lookups to compare its results with the extract before customer access begins.
