Circle V2 API Docs
    Preparing search index...
    deleteDocument: MutationProcedure<
        {
            input: { runId: string };
            meta: object;
            output: { deleted: boolean; runId: FormRunId };
        },
    > = ...

    Withdraw a run's generated document: the chart row goes, the run and its answers stay (the audit trail), patient_charts_contacts cascades, and the stored PDF is orphaned (@repo/storage has no delete). Only a settled run: the executor re-inserts the row if a mid-fill delete removes it, and a terminal status is the executor's last write, so the check needs no lock. Idempotent.