---
id: ADR-CRM-DQ-008
title: Observe merging through a durable job
product_area: crm
module: data-quality
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
decision: >-
  A durable job publishes its step definitions, runs one merge task and records
  failure; watched steps are settled from the transaction outcome and
  reconciliation handles lost executions.
constrains:
  - WF-CRM-DQ-006
  - WF-CRM-DQ-007
  - STATE-CRM-DQ-005
  - SVC-CRM-DQ-merges
origin: >-
  Andrew, 2026-10-12 (merge as durable job, recorded in
  services-crm:modules/merges/db/record-merge-jobs.table.ts);
  docs/merging/decisions.md#D9
alternatives:
  - option: Use only a queue worker
    why_not: >-
      The former pattern lacked the durable step reporting and lost-execution
      settlement required here.
  - option: Commit progress between merge stages
    why_not: Separate business commits would violate atomic merging.
consequences:
  - A new execution after a failed attempt creates another merge and job.
  - >-
    Cross-workspace monitoring reads job roots without workspace row policies;
    each workspace job also carries its customer.
supersedes: []
evidence:
  - >-
    services-crm at a8d1364f: modules/merges/services/jobs/record-merge-job.ts,
    record-merge-job-tasks.ts; aws/lambda/JOB_RECONCILER.ts.
---

# Observe merging through a durable job

## Context

Long merges need a monitored outcome even when workflow execution is lost.

## Decision

A durable job publishes its step definitions, runs one merge task and records failure; watched steps are settled from the transaction outcome and reconciliation handles lost executions.

## Alternatives Considered

Use only a queue worker. The former pattern lacked the durable step reporting and lost-execution settlement required here.

Commit progress between merge stages. Separate business commits would violate atomic merging.

## Consequences

A new execution after a failed attempt creates another merge and job. Cross-workspace monitoring reads job roots without workspace row policies; each workspace job also carries its customer.
