---
id: WF-PFM-DJE-004
title: 'Pause, resume, cancel or retry a job'
trigger: 'An operator selects pause, resume, cancel or retry for an existing job.'
product_area: platform
module: data-job-engine
revision: 1
status: draft
design_intent: confirmed
origin: >-
  services-platform:docs/proposals/rhythm-data-job-engine-plan.md §6.10
  cancellation and pause, §8.4 correction versus retry (approved 2026-10-12);
  services-crm:docs/milestones/CRM-M7-data-operations.md D-39
implementation_evidence: observed
inference: []
source_sha:
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-PFM-DJE-004
  - CAP-PFM-DJE-012
moves:
  - STATE-PFM-DJE-001
  - STATE-PFM-DJE-002
crosses:
  - SVC-PFM-DJE-engine
  - SVC-PFM-DJE-crm-data-jobs
hops:
  - 'n': 1
    actor_or_service: Console job actions
    action: >-
      Present controls permitted by current state and client authority, with
      confirmation for cancellation.
    anchor: >-
      react-console:components/data-management/data-jobs/job-actions.tsx:JobActions
    seam: sync
    on_failure: Show control failures and refresh stale job data.
    left_inconsistent: The service remains authoritative for state changes.
    observer: The person.
    provenance: observed
    source: >-
      react-console:lib/api/data-jobs/rules.ts:DATA_JOB_ACTIONS_NEEDING_CONFIRMATION
  - 'n': 2
    actor_or_service: Engine job control (pause)
    action: 'Lock and pause queued or running work, removing its queue entries.'
    anchor: 'macroservice-libraries:packages/data-jobs/src/job-control.ts:pauseDataJob'
    seam: sync
    on_failure: Refuse an illegal state; return already paused work unchanged.
    left_inconsistent: In-flight transactions can still commit.
    observer: Inspection reports held work and active-batch progress.
    provenance: observed
    source: 'macroservice-libraries:packages/data-jobs/src/job-control.ts:pauseDataJob'
  - 'n': 3
    actor_or_service: Engine job control (resume)
    action: >-
      Requeue pending, abandoned and exhausted transient batches from paused
      state.
    anchor: 'macroservice-libraries:packages/data-jobs/src/job-control.ts:resumeDataJob'
    seam: queue
    on_failure: Refuse continuation when the job is not paused.
    left_inconsistent: Earlier completed work remains settled.
    observer: Inspection reports active processing.
    provenance: test
    source: >-
      macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#holds
      a job paused before its source was read, and runs it to the end once
      resumed
  - 'n': 4
    actor_or_service: Engine job control (cancel)
    action: >-
      Mark cancellation, dequeue work, abandon pending batches and settle when
      no batch remains active.
    anchor: 'macroservice-libraries:packages/data-jobs/src/job-control.ts:cancelDataJob'
    seam: sync
    on_failure: Refuse final-state cancellation.
    left_inconsistent: Previously committed changes are retained.
    observer: The response distinguishes retained commits from unattempted work.
    provenance: test
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends
      the job cancelled, not failed, once the batch it waited for has finished
  - 'n': 5
    actor_or_service: Engine job control (retry)
    action: >-
      Retry held work or batches containing blocked outcomes, respecting applied
      rollback restrictions.
    anchor: 'macroservice-libraries:packages/data-jobs/src/job-control.ts:retryDataJob'
    seam: queue
    on_failure: Refuse jobs without eligible blocked work or with a prohibiting rollback.
    left_inconsistent: Refusals outside the retry scope remain unresolved.
    observer: Available-action detail explains retry eligibility.
    provenance: test
    source: >-
      macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
      to retry a job that has been rolled back, so its blocked rows are not
      written after the undo
idempotency: >-
  Repeated pause returns an already paused job. Terminal cancellation does not
  accept another control transition. Retried item writes skip existing receipts.
concurrency: >-
  Controls lock the parent state. A batch already executing can finish after a
  control request; cancellation settles once in-flight work finishes.
branches:
  - Paused file orchestration waits rather than ending its workflow.
  - The guard and transient exhaustion record distinct pause reasons.
waits:
  - File orchestration checks held state at configured wait intervals.
evidence:
  - >-
    macroservice-libraries at 54536a44: src/job-control.ts, data-job-actions.ts,
    bulk-data-job-tasks.ts; README.md#What a rollback promises, and what Retry
    does beside it.
  - >-
    services-crm at a8d1364f: services/jobs/contact-data-jobs.ts (pauseJob,
    resumeJob, cancelJob, retryJob).
  - >-
    react-console at baf6dae3:
    components/data-management/data-jobs/job-actions.tsx;
    lib/api/data-jobs/rules.ts.
controls: [TC-AVL-001, TC-AVL-004, TC-AVL-005, 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-004, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-PRV-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Pause, Resume, Cancel Or Retry A Job

## What It Does

Controls alter future processing at batch boundaries. They preserve committed changes and determine whether queued or unresolved work is held, abandoned or offered another attempt.

## The Flow

```mermaid
flowchart TD
  H1["Console job actions"] --> H2
  H2["Engine job control (pause)"] --> H3
  H3["Engine job control (resume)"] --> H4
  H4["Engine job control (cancel)"] --> H5
  H5["Engine job control (retry)"]
```

## When Something Fails

Controls refuse invalid transitions without substituting another action. Cancellation does not compensate earlier writes, and retries do not reinterpret rejected or conflicted input as corrected data.

## Open Design Questions

The recorded findings identify the remaining limits; this examination does not authorize stronger behavior or change the planning rules.
