Skip to content

Choose a developer integration

Detailed page. Use “On this page” to jump directly to the section you need.

Choose whether a health result belongs on a Lightning record page, in the current Flow or Apex process, in a large background job, or in optional Platform Event automation.

Only placing the Lightning card? Follow Install and verify, then return here when you need Apex, Flow, Batch Apex, or Platform Event automation.

Choose an integration based on who or what needs the result. Most implementations start with the Lightning card, Flow, or Apex. Use Platform Events only when a separate Flow, Apex trigger, or external integration must receive the result after the Record Health Check transaction completes successfully.

Record Health Check uses the same metadata-defined Check Sets and Checks across those surfaces. The integration choice changes how the evaluation starts and how the caller receives the result; it does not create a second configuration model.

StepGuideWhat you finish
1Lightning componentCard on a record page: automatic vs explicit runs, visible rows
2Flow actionsBranch in automation without custom Apex
3Lifecycle eventsOptional Platform Events for a separate receiving process

Stop after the row that meets your requirement. Use Agentforce only when the org has Agentforce enabled and the requirement needs a native agent action. MCP and REST are optional integration paths; they are not part of a normal card or Flow rollout.

Optional advanced taskGuideWhat you configure
Add native agent toolsAgentforce actionsAgent topics and exact Check or Check Set actions
Host an MCP serviceDeploy the MCP serviceExternal hosting, identity, MCP tools, and operations
Call the REST adapterAgent tool REST APIExternal Client App access and a dedicated service user

For immediate and background Apex patterns, use API examples. For receiving Flow, Apex, or external-integration examples, use Platform Event subscriptions.

Choose the packaged Permission Set for the entry point: Card User for the record-page card, User for Flow, Apex, Agentforce, and asynchronous Apex, MCP Integration for the versioned REST adapter, or Admin for configuration and authorized diagnostics. Every caller also needs the running principal’s normal record and field access. Use Read results to translate card labels and API statuses.

GoalStart hereWhat you will learn
Show health to a user on a record pageLightning componentAutomatic versus explicit runs, visible rows, and optional user-initiated events
Make an immediate or background decision in codeAPI examplesChoose the direct Apex API, Queueable, Batch, or Scheduled Apex
Branch in automation without custom ApexFlow actionsConfigure an Action and Decision element with explicit status paths
Answer record-health questions with a native agent actionAgentforce actionsConfigure exact Check or Check Set tools and preserve five-state results
Deploy the separately hosted MCP serviceDeploy the MCP serviceFollow and test all 11 HTTP, identity, tool, operational, and Salesforce security gates
Call approved agent tools from a hosted MCP serviceAgent tool REST APIAuthenticate a service identity and preserve the versioned tool contract
Notify a separate process after the health-check transaction completesPlatform Event subscriptionsBuild a receiving Flow, Apex trigger, or external integration and handle repeated delivery
Implement a decision the other Evaluation Types cannot expressRecent Account activityWrite the class used by a Verify with Apex Check

Text fallback:

Record-page user -> Lightning component
Immediate Flow or Apex decision -> Flow action or Apex API
Scheduled work or many records -> Queueable, Batch, or Scheduled Apex
Separate process after successful completion -> Platform Event

Record Health Check evaluates Salesforce records and returns the results to whatever started the run. The Lightning card, Flow action, and direct Apex API receive their response during the current request. Queueable, Batch, and Scheduled Apex perform the work in the background.

ConceptMeaning
Check SetThe parent configuration and normal unit of execution
CheckOne ordered check inside a Check Set
Immediate responseThe Lightning card, Flow, or direct Apex caller receives structured status data during its request.
Lifecycle eventsOptional Platform Events announce completed runs only after Salesforce successfully commits the transaction.
AccessEvaluation respects the running user’s Salesforce access

Start with a Check Set. Use a single Check only when your process intentionally needs one specific check rather than the complete configured health assessment.

Not thisWhy
A database of historical resultsRecord Health Check does not automatically create a result record. Flow, Apex, Batch Apex, or receiving automation must save one when history is required.
A Validation RuleIt reports health; it does not block record save
A remediation engineIt does not automatically update unhealthy records
A guaranteed-message queuePlatform Event publication or delivery can fail, and the same event can be delivered again.
A record-change listenerA run happens only when Lightning, Apex, Flow, or scheduled code invokes it
A replacement for Salesforce securityIt evaluates with the caller’s effective access
An all-record bulk scannerPublic requests are deliberately bounded
GoalStart hereImmediate outputOptional event source
Show health on a record pageLightning componentRows and Set summaryUSER_INITIATED; automatic load is blocked
Make a code-level decisionApex APITyped Check or Set responseAPEX_API, SCHEDULED, or BATCH
Branch in automation without codeFlow actionsFlow output variables and JSONFLOW
Answer through native Agentforce actionsAgentforce actionsVersioned structured Check or Check Set fieldsAGENT
Call through an approved MCP service identityAgent tool REST APIVersioned JSON Check or Check Set fieldsAGENT
Notify a separate process or export resultsPlatform eventsPlatform Event fieldsDepends on what started the run
Add a custom evaluation algorithmRecent Account activityNormal Check resultInherits the calling run
Check Set
├── Check A
├── Check B
└── Check C
evaluate(request) -> RecordHealthCheckResponse
├── summary with outcome counts
└── results[] with evaluation and optional display data

The successful status is PASS, not SUCCESS.

StatusMeaning
PASSThe configured health condition was satisfied
FAILEvaluation completed and found an unhealthy business condition
SKIPPEDEvaluation was intentionally prevented by applicability, dependency, or stop behavior
UNABLE_TO_EVALUATEConfiguration, access, or data conditions prevented a reliable conclusion
ERRORUnexpected system or evaluator failure

A Check Set uses the strongest contained result in this order: ERROR → UNABLE_TO_EVALUATE → FAIL → PASS → SKIPPED.

Versions in API responses and Platform Events

Section titled “Versions in API responses and Platform Events”

The direct response and Platform Events have separate contract-version fields. Receiving automation should read the contract-version field included in the response or event. Do not guess the available fields from the installed package version.

rhc.RecordHealthCheckResponse healthResponse = rhc.RecordHealthCheck.evaluate(
rhc.RecordHealthCheckRequest.forCheckSet(
'Account_Readiness', // Exact QualifiedApiName returned by Salesforce.
accountId
)
);
if (healthResponse.summary.failed > 0) {
// At least one Account Check returned FAIL.
// Use healthResponse.results to decide what this process should do next.
}

rhc is the installed package namespace. Account_Readiness represents a Check Set created by an administrator in your org. Replace it with the exact Qualified API Name copied from Setup; do not add or remove rhc__ yourself.

For method overloads, fields, limits, and exceptions, use the Apex API reference.

  1. Add Run Record Health Check Set from the Record Health Check action category.
  2. Provide Check Set Qualified API Name and Record ID.
  3. Add a Decision element with explicit branches for the returned Status.
  4. Connect the fault path.
  5. Use the count outputs or Result JSON when the decision needs Check-level detail.

For every input and output, use the Flow actions reference.

OutputTimingUse
Apex/Flow/LWC resultDuring the callMake the current decision or render the card
Platform EventAfter Salesforce commits successfullyNotify a separate process, save history, or export results

Enabling events does not change the result returned to the caller. A successful run does not prove that the receiving Flow, Apex trigger, or integration completed.

Lifecycle and restricted error-log publication are off by default:

  • Check Set Publish User Run Event enables one completed Set event.
  • Check Publish User Result Event enables one event for that server-finalized Check.
  • Check Set Publish Error Log Event publishes Record Health Check ERROR diagnostics only after explicit enablement and assignment of Record Health Check Error Log Publisher to the running identity.
  • Automatic Lightning page-load runs and page refreshes never publish. If an automatic card hides Run and Rerun, show the action or call the Check Set from Apex or Flow when another process needs an event.
LimitValue
Records in one public Apex or Flow call200
Concurrent Lightning Check evaluations5
Platform-event publish chunk100

For a Set request, planned evaluations equal records × active Checks.

Handle these cases separately:

CaseStatus / handlingNotes
Valid unhealthy resultFAILThe Check ran and found something that needs attention
Intentional non-runSKIPPEDApplicability or a dependency kept the Check from running
No reliable conclusionUNABLE_TO_EVALUATECard label: Unable to Check; Setup says Unable to Evaluate
Unexpected execution problemERRORCard label: System Error
Exception before a responseThrown faultInvalid request, missing access, or a governor limit
Successful response, then rollbackEvents suppressedPublish After Commit events do not fire when the transaction rolls back
Repeated or replayed event workReceiving automation responsibilityUse EventId__c so repeated delivery does not repeat the same follow-up action.

Use stable Statuses, Reason Codes, Failure Severities, and Qualified API Names for automation. Branch automation on those fields rather than administrator-authored message text.

  1. Configure and run the Check Set in a sandbox.
  2. Verify every status branch your integration handles.
  3. Test with users who have different record and field access.
  4. Confirm request volume stays within evaluation and event allocations.
  5. Enable publication for one Set or Check at a time.
  6. Verify successful commit, rollback, repeated-event handling, and receiving-automation failures.