data.identity.organization.prune ​
Hard-delete Organization rows soft-deleted beyond retention window
Hard-delete Organization rows soft-deleted beyond the retention window.
Guards: skip orgs with active OrganizationUser or CloudConnection rows. dry_run=True counts candidates without deleting.
Input: retention_days (default 90), dry_run (default False), actor. Output: organizations_pruned, skipped, dry_run, pruned_at.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-identity |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
retention_days | integer | No | — | Days after soft-delete before hard-delete (default 90) |
dry_run | boolean | No | — | If True, count candidates without deleting |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organizations_pruned | integer | Yes | — | — |
skipped | integer | Yes | — | — |
dry_run | boolean | Yes | — | — |
pruned_at | string | Yes | — | — |
retention_days | integer | No | — | — |
actor | 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 | — | complete | Prune organizations |
completed | No | Yes | Yes | — | Pruned |
failed | No | Yes | No | — | Prune failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.identity.organization.prune",
"initial_data": {
"retention_days": 123,
"dry_run": true,
"actor": "value"
}
}