Workspace delete
Permanently deletes deactivated workspaces once their retention period has passed.
How it works
Deleting a workspace first only deactivates it — the data is kept so the decision can be reversed. 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 the data — everything stored for that workspace is permanently deleted
- Keeps the current run record — the job’s own job run is kept so there is a record of the deletion; 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 turned on, 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 still be restored — see Delete workspace. 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. A retry continues from where the previous attempt left off |
| Orphaned accounts not cleaned up | A failed cleanup does not fail the run. Re-run the job to retry — or leave them: the next workspace deletion removes them too |