Workspace delete
Permanently deletes deactivated workspaces once their retention period has passed.
How it works
Deactivating a workspace is a soft action — the data stays on disk so an administrator can reverse the decision. After a retention period, this job permanently removes everything tied to the workspace:
- Confirms eligibility — the workspace must be deactivated and its deactivation date must be older than the retention period
- Deletes per-table — every workspace-scoped table has its rows for that workspace hard-deleted
- Preserves the current run record — the job’s own job_run record is kept so the deletion is auditable; every other job run for the workspace is also removed
- Cleans up orphaned accounts — after the deletion, any user account that no longer belongs to any workspace is removed too
This is the only batch job that runs on deactivated workspaces. Every other job skips them.
When it runs
The job runs automatically and only triggers on workspaces that are both deactivated and past the retention period (default 30 days).
Parameters
| Parameter | Default | Description |
|---|---|---|
| Retention Days | 30 | Number of days to keep a deactivated workspace before deleting it |
| Dry Run | false | When enabled, report what would be deleted without doing anything |
Job results
| Metric | Description |
|---|---|
workspace_id | ID of the workspace processed |
workspace_name | Name of the workspace at deactivation time |
deactivated_at | Timestamp when the workspace was deactivated |
deleted | true when the workspace was permanently deleted, false for a dry run |
orphaned_accounts_deleted | Number of orphaned user accounts removed afterwards (only when present) |
A run that is skipped reports skipped: true with a reason such as "workspace not deactivated" or "retention period not reached".
Recovering a workspace before deletion
While a workspace is deactivated but the retention period has not passed, it can be reactivated from . Once this job has run, the deletion is permanent — there is no undo.
Troubleshooting
| Issue | Solution |
|---|---|
| Workspace was deleted too early | The retention period defaults to 30 days. If you scheduled with a smaller value, the job ran with that smaller value. Check the run details |
| Deletion failed midway | Re-run the job. Per-table deletions are independent, so a retry continues from where the previous attempt left off |
| Orphaned accounts not cleaned up | The cleanup step logs but does not fail the run. Re-run the job to retry — or accept the small leftover, the next workspace delete will pick them up |