When a HotDocs interview is completed and all assembled documents are downloaded to Salesforce, the system automatically removes the associated Work Item from the HotDocs Advance platform. This article explains how the cleanup process works, how to monitor it, and how to configure the optional background job for existing interviews.
How Work Item Cleanup Works
After you complete an interview and confirm that all documents are downloaded, the system automatically triggers a background process to remove the associated Work Item from HotDocs Advance.
- No configuration is required for this process.
- The cleanup applies automatically to all newly completed interviews.
- The system sends a removal request as part of standard processing.
Error Handling and Retries
If the system cannot remove the Work Item:
- It automatically retries the request.
- The system tracks consecutive failures.
After the system reaches the maximum number of retry attempts:
- It marks the interview as Escalated.
- An administrator must review the issue and reset the interview to resume retries.
Cleanup status
The Cleanup Status field on a HotDocs Interview record shows the current state of the Work Item on the HotDocs platform.
| Status | Description |
|---|---|
| Pending | The interview is complete, and the Work Item is queued for cleanup. |
| Cleaned | The Work Item has been successfully removed from the HotDocs platform. |
| Failed | The removal request failed. The system will retry automatically during the next run. |
| Escalated | The maximum number of retry attempts has been reached. Administrator action is required. |
Reset an Escalated Interview
When an interview reaches Escalated status, the system stops automatic retries. To resume processing, reset the status to Pending. To reset an escalated interview, follow the below instructions:
- Open the HotDocs Interview record in Salesforce.
- Locate the Work Item Cleanup section on the record page.
- Click Edit.
- Set the Cleanup Status field to Pending.
- Click Save.
- The system includes the interview in the next background cleanup job run.
- Cleanup retries resume automatically.
Note: If the interview escalates again after resetting, review the Last Cleanup Error field before attempting another reset.
Schedule Background Job
For interviews created before this feature was deployed, schedule a background job to process cleanup in bulk. This job is optional because new interviews are cleaned up automatically. To schedule the background cleanup job, follow the below instructions:
- Go to Salesforce Setup.
- In the Quick Find box, search for Scheduled Jobs.
- Navigate to Environments > Jobs > Scheduled Jobs.
- Click Schedule Apex.
- In the Job Name field, enter HotDocs Work Item Cleanup.
- In the Apex Class field, select HotDocsInterviewCleanupSchedulable.
- Set the frequency to Weekly/Monthly.
- Set the Start Date.
- Set an End Date. (Optional)
- Set the Preferred Start Time.
- Click Save.
- The job runs daily at the scheduled time.
- The system processes any interviews pending cleanup.
Opt In Existing Interviews
Interviews created before this feature is enabled are not automatically included in the cleanup process. You must manually mark them for processing. To do this, follow the below instructions:
- Open the HotDocs Interview record in Salesforce.
- Click Edit.
- Set the Cleanup Status field to Pending.
- Click Save.
The system processes the interview during the next scheduled cleanup job run.
Review records carefully before making bulk updates. Setting many records to Pending at once queues all of them for deletion in the next run, which may impact system performance or processing time.

