---
schema_version: "1"
id: fd8996e1f18394b5723164f6091d9625d7926d66a31464812e22c7b4121556a1
title: Launch a Flow When a Recommendation Is Accepted or Rejected
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/nba_launch_flow_accepts_rejects.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.nba_launch_flow_accepts_rejects.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: feb98d13e26322a5aa122945f6ba3635446dda5ae40cec9c674c5abd77326397
description: Each recommendation is associated with a single flow. By default, Next Best Action launches a flow when a user accepts a recommendation. The flow then performs an action, such as updating a case or sending an email. But you can also launch a flow when a user rejects a recommendation, which gives you more flexibility. For example, a flow could run an automated process, write to another system, or create a reminder email when a recommendation is rejected.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Launch a Flow When a Recommendation Is Accepted or Rejected

Each recommendation is associated with a single flow. By default, Next Best Action launches a flow when a user accepts a recommendation. The flow then performs an action, such as updating a case or sending an email. But you can also launch a flow when a user rejects a recommendation, which gives you more flexibility. For example, a flow could run an automated process, write to another system, or create a reminder email when a recommendation is rejected.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.nba_ref_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Next Best Action.">View supported editions for Next Best Action</a>.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d330397e60">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">To open, edit, or create a flow in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">To create and save Lightning pages in the Lightning App Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">Customize Application</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">To run a recommendation strategy on a Lightning record page:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d330397e60 ">
              <p>Run Flows</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Flow User field enabled on the user detail page</p>
            </td>

          </tr>
        </tbody>
      </table>

For example, at a telecommunications company, the admin configures the Next Best Action component to display recommendations to its customer service representatives (CSRs). When a CSR accepts a recommendation for a customer who wants to purchase a discounted service, a flow is launched to calculate the discount. The admin analyzes the reactions to the recommendation, and is confused about why the CSRs are rejecting it. To help get answers, the admin uses Next Best Action to launch a questionnaire flow every time the recommendation is rejected.

This feature is available for:

- The Einstein Next Best Action component used with Lightning record pages
- The Suggested Actions component used in Experience Builder
- The Actions and Recommendations component used with Lightning console apps

To assign a flow that runs when a customer accepts or rejects the recommendation, create an input variable in the flow to accept the `isRecommendationAccepted` value. Then add a Decision element to the flow that’s based on that value.

1. In Flow Builder, configure a flow that’s associated with a recommendation. Be sure to activate the flow because Next Best Action can’t call an inactive flow from a recommendation.
2. Create the Boolean `isRecommendationAccepted` input variable.
3. Add a Decision element and select **Manually Set Conditions**, and use the `isRecommendationAccepted` variable in your outcome conditions.
4. Set the outcome label of the first outcome to Accepted. Then configure the first decision outcome to determine whether the `isRecommendationAccepted` variable is true.
5. Change the label of the Default Outcome to Rejected.
    
    ![The Decision element with the isRecommendationAccepted variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/next_best_action/nba_launch_flow_reject_decision.png)
6. Add any additional flow elements to handle each outcome path.
7. Add a flow action.
8. To add the flow, edit the recommendation.
9. When you add the Next Best Action component to a Lightning record page, select **Launch Flow on Rejection**.
    
    ![The Next Best Action component with the Launch Flow on Rejection checkbox](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/next_best_action/nba_component_launch_flow_reject.png)

#### See Also

- [Launch a Flow When a Recommendation Is Accepted](https://help.salesforce.com/s/articleView?id=platform.nba_launch_flow_accepts.htm&release=264.0.0&type=5 "Each recommendation is associated with a single flow. By default, Next Best Action launches a flow when a user accepts a recommendation. The flow then performs an action, such as updating a case or sending an email.")
- [Variable Resource](https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_variable.htm&release=264.0.0&type=5 "Store a value that can be used or changed throughout the flow.")
- [Decision Element](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_decision.htm&release=264.0.0&type=5 "Evaluate a set of conditions, and route users through the flow based on the outcomes of those conditions. This element performs the equivalent of an if-then statement.")
- [Einstein Next Best Action Component](https://help.salesforce.com/s/articleView?id=platform.nba_lab_cmp.htm&release=264.0.0&type=5 "Einstein Next Best Action uses strategies that apply your org’s business rules to display context-sensitive suggested offers and actions on your Lightning record pages.")