Home / security / customer-data-request-workflow
customer-data-request-workflow
Implement GDPR/CCPA data subject rights (access, deletion, rectification) using Salesforce Privacy Center and/or custom workflow. NOT for the underlying erasure mechanics (Individual sObject, ShouldForget, ContactPointConsent) — use security/gdpr-data-privacy. NOT for general backup or org-level data retention policy.
Open the skill folder on GitHub
Customer Data Subject Request (DSR) Workflow
A data subject request is a regulatory workflow with a deadline, a scope that spans more objects than anyone expects, and an evidentiary requirement: you must be able to show a regulator what you did, when, and to which records.
Scope of this skill. This is the workflow: intake, scoping, orchestration, evidence, rehearsal, and the operational commitments that follow. The underlying erasure mechanics — the Individual sObject's full field model, ShouldForget semantics in depth, ContactPointConsent and the consent object family — belong to security/gdpr-data-privacy. They appear here only where they change a workflow decision.
Three building blocks, and which you use changes the whole design:
| Building block | What it is |
|---|---|
| Individual | Stores the subject's privacy preferences. Available "if Data Protection and Privacy is enabled," and not available to Customer Community, Partner Community, or Customer Portal users. |
| Privacy Center | Managed policies that "anonymize or transfer personal data from your org at your customer's request," surfaced as DsarPolicy and DsarPolicyLog |
| Custom workflow | Policy-as-Custom-Metadata plus batch or Queueable Apex, for orgs without Privacy Center |
Before Starting
- Separate access from erasure. They differ in scope, direction, output, SLA,
approval gate, and risk. Model them as two workflows sharing an
Individualrecord, not one handler with a mode flag. - Confirm Data Protection and Privacy is enabled if the design uses
Individual, and plan a staging object if requests can arrive from a portal — community users cannot see the object. - Get the legal positions before you build: deletion versus pseudonymisation,
what cannot be erased and under which competing obligation, and the applicable deadline per jurisdiction. These are legal artifacts engineering cannot author.
- Name the owner of every off-platform copy: sandboxes, backups, CRM Analytics
datasets, warehouse extracts, marketing platform. Each needs a stated position in the runbook.
Core Concepts
Preferences are not actions
Individual.ShouldForget is the "Preference to delete records and personal data related to this customer." SendIndividualData is the "Preference to export personal data for delivery to the customer." Both are stored intentions. Their value is as the anchor: they record that the request was made, start the SLA clock, and give downstream jobs a queryable population.
Privacy Center: policies are inactive by default
DsarPolicy.IsActive — "Indicates whether this policy can be used (true) or not (false) for data subject (customer) requests. The default value is false." Access requires ReadAllData or PrivacyDataAccess.
DsarPolicyLog is the evidence, generated as a side effect of execution so it cannot drift from what was done. It carries the requesting subject's ID, the request and completion timestamps, the generated file's deletion and download timestamps, an error field, and the ID of the employee or admin who acted on the subject's behalf.
The object inventory is the hard part
Build the relational half from Schema.DescribeSObjectResult.getChildRelationships(). Then add what describe cannot reach:
IDENTITY portal/Experience Cloud Users; Person Accounts (Account AND Contact)
CONSENT ContactPointEmail/Phone/Address, ContactPointConsent,
ContactPointTypeConsent, AuthorizationFormConsent,
CommunicationSubscriptionConsent, PartyConsent
FREE TEXT Case Comments, Chatter, Email Messages, Notes, Attachments,
ContentDocument/ContentVersion bodies, long-text fields
ARCHIVE <Object>History, FieldHistoryArchive, Setup Audit Trail
OFF-PLATFORM backups, sandboxes, CRM Analytics, warehouse, marketing platform
The archive does not cascade
"If you delete a record in your production data, the delete cascades to the related history tracking records, but Salesforce doesn't delete the history copied into the
FieldHistoryArchivebig object."
In a Shield org this leaves the old values of the erased fields in a separate store. It is the most commonly missed step in this domain and the easiest to prove missing.
Deleted is not deleted
A standard delete is a soft delete. Follow with Database.emptyRecycleBin or a Bulk API hard delete, and verify.
The audit must not become a second copy
Log a SHA-256 hash of the original value, never the value. Write the audit row before the DML so a failure mid-run leaves evidence of the attempt.
Common Patterns
Pattern A — Privacy Center
Author object-scoped policies, activate them as a distinct verified step, and use DsarPolicyLog as the compliance report. Completeness of the erasure equals completeness of the object inventory. Example 2 in