Skip to content

Run a Check from Flow

Guide6 min read

Run a Record Health Check Set or a single Check from a Salesforce Flow and branch on the result, without writing Apex. Record Health Check provides two Flow actions that evaluate a record and return its status, so a Flow can, for example, notify an Account owner when the Account’s Checks fail.

Flow Builder lists both actions in the Record Health Check category.

ActionRunsReturns
Run Record Health Check SetEvery active Check in one Check SetAn overall Status, a count for each result, and Result JSON
Run Record Health CheckOne CheckThe Check’s Status, its Reason Code, and Result JSON

Use Run Record Health Check Set when a Check depends on a Prerequisite Check. A single-Check request evaluates the selected Check without its prerequisite.

A record-triggered Flow runs when an Account’s Rating changes to Cold. It runs the Account_Data_Quality Check Set for that Account. When the result is FAIL, the Flow creates a Task for the Account owner to review the Account; otherwise it ends.

  1. Create, activate, and test the Check Set on the record-page card. See Configure Check Sets and Checks.
  2. Copy the Check Set’s API name: in Setup, open Custom Metadata Types → Record Health Check Set → Manage Records, open the Check Set, and copy its Record Health Check Set Name. A Check Set your organization created has no prefix, such as Account_Data_Quality. A Check Set that installs with the package has the rhc__ prefix, such as rhc__Example_Account_Check_Builder_Guide.
  3. Identify the user whose action starts the Flow. Record Health Check evaluates as that user, with that user’s record and field access, even when the Flow itself runs in system context. Assign Record Health Check User to the users who start the Flow, and confirm they can read the records and fields that the Checks use.
  4. Decide whether another process must also receive the result as a Platform Event. If not, you use NONE.
  1. In Setup, enter Flows in Quick Find, select Flows, and then select New Flow.

  2. Select Record-Triggered Flow. Set Object to Account, trigger the Flow when a record is updated, and set the entry condition Rating equals Cold. Under Optimize the Flow for, select Actions and Related Records, so the Flow runs after the record is saved and the Checks read the saved values.

  3. Add an Action element. Search for Run Record Health Check Set and select it.

  4. Set the inputs:

    InputValue
    Check Set Qualified API NameAccount_Data_Quality
    Record ID{!$Record.Id}
    Event PublicationNONE
  5. Add a Decision element named Request succeeded? after the action. Add an outcome Succeeded where the action’s Success output equals true. The default outcome handles a rejected request.

  6. On the Succeeded path, add a Decision element named Result with an outcome for each status your Flow handles. For this example, add Failed where Status equals FAIL.

  7. On the Failed path, add a Create Records element that creates a Task for {!$Record.OwnerId} with Related To set to {!$Record.Id}.

  8. On the default outcome of Request succeeded?, record the action’s Error Type and Error Message in the way your organization handles automation errors.

  9. Connect the action’s fault path to your organization’s Flow fault handling. It runs only when a Salesforce error stops the action from returning outputs.

  10. Save the Flow, debug it, and then activate it.

What the action returnsMeaningWhat the Flow should do
Success is falseThe request was rejected, for example because of an unknown API name.Read Error Type and Error Message. Ignore Status.
Status is PASSThe record meets the requirements.Continue.
Status is FAILThe record does not meet a requirement. This is not a Flow error.Take the business follow-up action.
Status is SKIPPEDThe Checks did not apply to the record.Continue, or handle separately.
Status is UNABLE_TO_EVALUATEAccess, configuration, or data prevented a reliable answer.Route for an administrator to review.
Status is ERRORAn unexpected problem stopped a Check.Route for technical investigation.
The fault path runsA Salesforce error stopped the action before it returned outputs.Use your Flow fault handling.

For a Check Set, Status is the most serious result among its Checks, in this order: ERROR, UNABLE_TO_EVALUATE, FAIL, PASS, SKIPPED. A Check Set where three Checks pass and one fails returns FAIL. Use the count outputs, such as Failed Count, when the Flow needs to know how many Checks had each result.

Never send FAIL, UNABLE_TO_EVALUATE, or ERROR to the fault path. They are results, not errors, and the Flow interview completes normally.

  1. Select Debug, choose an Account that fails a Check, and run the Flow. Confirm that it follows the Failed path and creates the Task.
  2. Debug with an Account that passes every Check, and confirm that the Flow ends without a Task.
  3. Debug with an API name that does not exist, and confirm that the default outcome of Request succeeded? runs with Error Type VALIDATION.
  4. Run the Flow as a user with the same access as the real users. If your org allows it, select Run flow as another user in the Debug options. The result can differ from an administrator’s, because Record Health Check reads data with the running user’s access.
  • Salesforce can send many records to one action call, such as when a data load updates many Accounts. The records are grouped by Check or Check Set and Event Publication value. One call can contain at most 10 groups, and each group at most 200 records.
  • A Check Set with more than 25 active Checks returns Success false with Error Type LIMIT, and no Check runs.
  • The Result JSON of all records in one call can total at most 2,000,000 characters. Records past that point return Success false with Error Type LIMIT.
  • Formula Checks are limited to 95 formula evaluations per transaction, about one per record per Formula Check or Applies When (Formula). A large data load can exceed it; see Platform limitations.
What you seeWhat to check
The action is not in Flow BuilderRecord Health Check is installed, and you are searching the Record Health Check category.
Error Type is AUTHORIZATIONThe Flow’s running user has Record Health Check User.
Error Type is VALIDATIONThe API name is exact and active, Record ID is set, and Event Publication is NONE, ACTIONABLE, or ALL.
Status is UNABLE_TO_EVALUATEThe running user’s access to the objects and fields the Checks read.
The Flow and the card give different resultsThe users and their access. See Troubleshoot execution context.