Skip to content

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:

  1. Confirms eligibility — the workspace must be deactivated and its deactivation date must be older than the retention period
  2. Deletes the data — everything stored for that workspace is permanently deleted
  3. 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
  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 turned on, 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 still be restored — see Delete workspace. 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. A retry continues from where the previous attempt left off
Orphaned accounts not cleaned upA failed cleanup does not fail the run. Re-run the job to retry — or leave them: the next workspace deletion removes them too