Organization deletions #
For the purposes of complinace with NDA of our clients and reduction in storage use Tofu supports full organization deletion.
The main implementation is located in organization_delete.rs.
Any new table additions require updates to bonsai housekeeping if they’re tied to organizations or entities.
Retention policy #
Some companies require custom data retention policies: 14 days, 60, etc. By default, Tofu’s retention policy is 30 days after organization has been soft-deleted.
For custom retention policy please update clerk organization private metadata, specifically data_retention_period_in_days

Logging #
Currently, Tofu only records organization id and entity ids for every deleted company.
Additional info #
- At most 5 organizations are deleted per cron job.
- Organization deletions occur without a transaction to avoid frequent restart required errors. This shouldn’t affect the outcome since until organization/entity hasn’t been deleted bonsai-housekeeping will retry to delete all data.