---
id: WF-PFM-NOT-016
title: Purge or reset a workspace's notifications and communications
trigger: Workspace lifecycle requests reset or deletion.
product_area: platform
module: notifications
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
- CAP-PFM-NOT-008
- CAP-PFM-NOT-020
crosses:
- SVC-PFM-NOT-notifications
- SVC-PFM-NOT-communications
hops:
- n: 1
  actor_or_service: Notifications lifecycle participant
  action: For deletion remove the sixteen workspace notification tables in dependency order; for reset
    clear operational work and challenges while retaining configuration, identities and text metering.
  anchor: services-platform:modules/notifications/services/maintenance/tenant-participant.ts:platformNotificationsParticipant
  seam: state_machine
  on_failure: Let lifecycle execution retry the failed step.
  left_inconsistent: Partial cleanup remains until a later successful step.
  observer: Lifecycle step results and deletion counts.
  provenance: test
  source: services-platform:modules/notifications/tests/integration/services/persistence/tenant-purges.integration.spec.js#removes
    the operational records and leaves the configuration and the metering as they were
- n: 2
  actor_or_service: Communications lifecycle participant
  action: Delete communication tables individually in dependency order through the authorized purge function
    while the workspace is deleting, then remove stored object prefixes.
  anchor: services-platform:modules/communications/services/persistence/tenant-purges.ts
  seam: state_machine
  on_failure: Retry the failing table or object cleanup step.
  left_inconsistent: Remaining rows or objects survive until cleanup succeeds.
  observer: Lifecycle step results.
  provenance: observed
  source: services-platform:modules/communications/services/persistence/tenant-purges.ts
- n: 3
  actor_or_service: Sender lifecycle participant
  action: Delete provider sender identities before removing the sender setting.
  anchor: services-platform:modules/communications/services/sender-identity/tenant-participant.ts
  seam: state_machine
  on_failure: Report sender cleanup failure.
  left_inconsistent: Retain the setting so remaining provider identities can be located.
  observer: Lifecycle step results.
  provenance: observed
  source: services-platform:modules/communications/services/sender-identity/tenant-participant.ts
idempotency: Purge removes remaining rows in repeatable batches and reports counts until empty.
concurrency: Communication purge checks deleting state and execution authority; this flow does not stop
  existing pipelines.
branches:
- Communication history has no reset participant and survives reset.
- Shared definition registry and reconciliation job roots are outside workspace cleanup.
waits: []
evidence:
- 'services-platform at ad3f6a65: modules/notifications/services/{maintenance/tenant-participant,persistence/tenant-purges}.ts;
  modules/communications/services/{persistence/tenant-purges,sender-identity/tenant-participant,storage/tenant-objects}.ts;
  modules/tenants/services/lifecycle/participants.ts.'
controls: [TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, 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-DAT-006, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, 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-SEC-001, TC-SEC-002, TC-SEC-003, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---
# Purge or reset a workspace's notifications and communications

## What It Does

Workspace lifecycle requests reset or deletion.

## The Flow

```mermaid
flowchart TD
    h0["For deletion remove the sixteen workspace notification tables in dependency order"]
    h1["Delete communication tables individually in dependency order through the authorized purge function while the worksp"]
    h0 --> h1
    h2["Delete provider sender identities before removing the sender setting"]
    h1 --> h2
```

## When Something Fails

The hop rows identify each retry boundary, any state left behind and the available observer. Purge removes remaining rows in repeatable batches and reports counts until empty. Communication purge checks deleting state and execution authority; this flow does not stop existing pipelines.

## Open Design Questions

Communication history has no reset participant and survives reset. Shared definition registry and reconciliation job roots are outside workspace cleanup.
