---
id: WF-ACC-CLS-007
title: Export the close history with the workspace's data
trigger: >-
  The workspace lifecycle caller invokes Accounting’s close-history export
  callback.
product_area: accounting
module: close
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
implements:
  - CAP-ACC-CLS-016
crosses:
  - SVC-ACC-CLS-fiscal-close
idempotency: >-
  Run-key pagination and the creation cutoff bound membership. Mutable runs and
  later snapshots mean a replayed batch can return changed content.
concurrency: >-
  The dataset declares a snapshot per batch and omits records created after the
  cutoff. Existing runs can change between batches while closing continues.
hops:
  - 'n': 1
    actor_or_service: Platform workspace lifecycle
    action: >-
      Expose the close export participant and dataset dependency to the
      lifecycle caller; external dispatch is not verified from this declaration.
    anchor: >-
      services-accounting:modules/maintenance/services/participants/fiscal-close-participant.ts:accountingFiscalCloseParticipant
    seam: sync
    on_failure: Platform dispatch and retry behavior remain unverified here.
    left_inconsistent: >-
      A staged partial export may exist in the caller; these declarations do not
      establish its lifecycle.
    observer: The lifecycle caller owns progress reporting.
    provenance: unknown
    source: FND-ACC-CLS-052
  - 'n': 2
    actor_or_service: Fiscal close export reader
    action: >-
      Read workspace-scoped run batches through the cutoff, embedding snapshots
      and withholding command keys and operational job records.
    anchor: >-
      services-accounting:modules/fiscal-close/export/fiscal-close.dataset.ts:fiscalCloseExport
    seam: sync
    on_failure: >-
      A failed read returns an error; caller retry policy is outside this
      verification.
    left_inconsistent: No Accounting record is changed by export.
    observer: The export callback returns its part outcome to the caller.
    provenance: observed
    source: >-
      services-accounting:modules/fiscal-close/export/fiscal-close.dataset.ts:fiscalCloseExport
evidence:
  - >-
    services-accounting at f47cb263:
    modules/fiscal-close/export/fiscal-close.dataset.ts, fiscal-close.reader.ts;
    aws/accounting.export-datasets.ts;
    modules/maintenance/services/participants/fiscal-close-participant.ts.
controls: [TC-IAM-001, TC-IAM-005, TC-IAM-006, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-DAT-002, TC-DAT-005, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-005, TC-PI-002, TC-PI-003, TC-PI-005]
---

# Export the close history with the workspace's data

## What It Does

Customer export includes the workspace’s close and reopen runs with each captured snapshot embedded. Operational job tables are withheld, and the request command key is excluded.

## The Flow

```mermaid
sequenceDiagram
  participant Caller as Lifecycle caller
  participant Reader as Close export callback
  participant Data as Workspace close records
  Caller->>Reader: request dataset batch
  Reader->>Data: read runs through cutoff with snapshots
  Data-->>Reader: batch values
  Reader-->>Caller: export part outcome
```

## When Something Fails

The callback fails without changing Accounting when a batch cannot be read. Platform owns dispatch, staged parts and recovery, which cannot be verified from these callbacks. Existing run outputs can change after the export cutoff; repeating a batch does not guarantee identical values.

## Open Design Questions

Cancellation attribution lives only in withheld job history. Product should decide which execution facts belong in customer-retained records and obtain the Platform dispatch evidence before claiming a queue or retry guarantee.
