Provision and remove module data with the workspace lifecycle
What It Does
The workspace provisioning, deletion or reset workflow invokes the registered module participants. The selected lifecycle operation and participant resource declarations determine what reset retains.
The Flow
Provision every registered search type with defaults, ledger state and initial rebuild work. Remove workspace query definitions, schedules, reports, generations, file rows and queue work, assignments and Explorer state while retaining product-level custom-table history. Delete provider documents before clearing search configuration, claims, ledger and rebuild records. Clear Platform self-test rows, workspace policy and snapshot ledger versions in dependency-safe order after other owners remove their rows. Remove staged and published package bytes before workspace export history, then settings for deletion; reset clears history while retaining settings.
When Something Fails
The workspace job retries unfinished provisioning. A type can lack its scope until retry succeeds. Retry unfinished deletion batches. Completed file objects can remain in the legacy storage bucket until its retention lifecycle removes them. Wait for open work or report blocked cleanup when provider credentials are absent. Blocked scopes can retain provider documents. The workspace job retries an incomplete batch. Some snapshot rows can remain until deletion progresses. Retry incomplete storage or persistence cleanup. Unfinished bytes or rows can remain until retry, with staging also subject to its three-day retention.
Idempotency and Concurrency
Provisioning reuses existing scopes. Purge participants report more work until their batches are empty and can retry incomplete cleanup. Search purge waits for open rebuild work; workers stop indexing deleting workspaces and events acknowledge without further writes there.