subscription.retention.apply ​
Apply configured org retention to workflow/audit storage with dry-run support
Apply per-organization retention policy to workflow and audit storage.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID |
subscription_uuid | uuid | No | — | Subscription UUID for policy attribution |
dry_run | boolean | No | — | Plan only; defaults true |
batch_size | integer | No | — | Maximum rows/workflows per category |
include_workflow_states | boolean | No | — | Apply workflow state retention |
include_workflow_events | boolean | No | — | Apply workflow event retention |
include_scheduled_transitions | boolean | No | — | Apply completed scheduled transition retention |
include_audit_logs | boolean | No | — | Apply audit log retention |
include_usage_snapshots | boolean | No | — | Apply usage snapshot retention |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
subscription_uuid | uuid | No | — | — |
dry_run | boolean | No | — | — |
policy | json | No | — | — |
cutoffs | json | No | — | — |
planned | json | No | — | — |
deleted | json | No | — | — |
storage_enforcement | json | No | — | — |
warnings | list | No | — | — |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.retention.apply",
"initial_data": {
"organization_uuid": "value"
}
}