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:

  1. Confirms eligibility — the workspace must be deactivated and its deactivation date must be older than the retention period
  2. Deletes per-table — every workspace-scoped table has its rows for that workspace hard-deleted
  3. 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
  4. 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

ParameterDefaultDescription
Retention Days30Number of days to keep a deactivated workspace before deleting it
Dry RunfalseWhen enabled, report what would be deleted without doing anything

Job results

MetricDescription
workspace_idID of the workspace processed
workspace_nameName of the workspace at deactivation time
deactivated_atTimestamp when the workspace was deactivated
deletedtrue when the workspace was permanently deleted, false for a dry run
orphaned_accounts_deletedNumber 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 AdministrationWorkspace. Once this job has run, the deletion is permanent — there is no undo.

Troubleshooting

IssueSolution
Workspace was deleted too earlyThe 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 midwayRe-run the job. Per-table deletions are independent, so a retry continues from where the previous attempt left off
Orphaned accounts not cleaned upThe 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