Loading
Feature Degradation | Agentforce Voice Read More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Example: Configure an Approval Workflow

          Example: Configure an Approval Workflow

          Let’s build a complete approval workflow to determine the approvals required on a quote’s discounts, implementing both Smart Approvals and Dynamic Approval Notifications.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions where Advanced Approvals is enabled
          User Permissions Needed
          To configure approval workflows: Approval Designer

          To demonstrate this, we'll use an example of a vendor who sells products that require quotes. This vendor offers discounts and, to ensure approvals are applied efficiently, sets the following conditions:

          discount value approval level
          Up to 25% No approval necessary
          Over 25% Approval necessary
          Over 50% Second level of approval necessary

          To ensure our approval process works seamlessly, you must first configure the approvers. This involves mapping them to their correct personas and assigning the corresponding permissions to control their access and actions. See Advanced Approvals Personas and Permissions for more information.

          Here are the steps you must follow to configure an approval workflow.

          1. Create the Get Quote Record Flow
          2. Create a Discount Approval Workflow
          3. Make Decisions for Your Discount
          4. Create an Approval Stage

          Create the Get Quote Record Flow

          1. From Setup, find and select Flows.
          2. Select New Flow.
          3. Select Autolaunched Flow (No Trigger).
          4. Create a variable to store the quote record that we will fetch based on the ID provided as input.
            1. Click Resource iconand select New Resource.
            2. Specify these details.
              • Resource Type: Variable
              • API Name: FetchedQuoteRecord
              • Description: Store the quote record that fetches the quote ID
              • Data Type: Record
              • Object: Quote
              • Select Available for output.
            3. Click Done.
          5. Create another variable to receive the quote ID as input.
            1. Resource Type: Variable
            2. API Name: InputQuoteID
            3. Description: Receive the quote ID as input
            4. Data Type: Text
            5. Select Available for output.
            6. Click Done.
            Create new resource
          6. Now, on your Flow Builder canvas, click Add element iconand select the Get Records element to get the quote record details.
          7. Specify these details.
            1. Label: Get the Complete Record
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
            3. Object: Quote
          8. Then, set a condition to filter quote records.
            1. Condition Requirements: All Conditions Are Met (AND)
            2. Field: Quote ID
            3. Operator: Equals
            4. Value: InputQuoteID
          9. Then, click Add element icon to add the Assignment element to get the fetched quote record and assign it to the fetched quote record variable.
          10. Specify these details.
            1. Label: Assign the Fetched Record
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
          11. Set the variable values.
            1. Variable: FetchedQuoteRecord
            2. Operator: Equals
            3. Value: Quote from Get the Complete Record
          12. Save your flow as Fetch Quote Details and activate it.
            Your flow should look like this.
            Create quote flow

          Create a Discount Approval Workflow

          1. From Setup, find and select Flows.
          2. Select New Flow.
          3. Select Autolaunched Flow Approval Process (No Trigger).
          4. Click Resource iconand and verify that you see these predefined variables..
            • recordId - Represents the submitted approval record
            • submitter - Represents the user who submitted the approval
            • submitterComments - Represents the comments provided by the submitter
            If you don’t see these predefined variables, verify if you’ve selected the right automation flow - Autolaunched Flow Approval Process (No Trigger).
          5. Now, on your Flow Builder canvas, click Add element iconand select the Stage element to invoke the fetch the quote record.
          6. Specify these details.
            1. Label: Get quote record
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
            3. Condition: When all steps have been marked Completed, the state is marked Completed
          7. In the Get quote record element, click + Add Step.
          8. Select Background Step and specify these details.
            1. Label: Get quote record for record id
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
            3. Condition: When the stage starts, the step starts
          9. Under the Select an Action to Run section, select the flow you created in the previous step.
            1. Action: Fetch Quote Details
            2. InputQuoteID: recordId
            Your background step should look like this.
            Background step

          Make Decisions for Your Discount

          Decision elements are used to evaluate conditions and route the workflow down different paths. For example, a designer can configure a Decision element to check if a business rule is met, such as a discount exceeding a certain discount percentage. Based on the outcome, the approval workflow will be routed to the next step or stop the process by routing it to a default outcome.

          1. On the same flow, click Add element icon and select the Decision element.
          2. Enter If quote discount is greater than 25 as the label.
          3. Next, set your outcomes.
          4. Specify these details under New Outcome.
            1. Outcome Label: Discount > 25
            2. Condition Requirements to Execute Outcome: All Condition Are Met (AND)
            3. Resource: Get quote record > Get quote record for record id > Outputs > FetchedQuoteRecord > Discount
            4. Operator: Greater Than
            5. Value: 25
            Your outcome should look like this.
            Outcome

          Create an Approval Stage

          Approval Steps are used to assign a request to a specific user or queue and can require the approver to complete a specific action. For example, following an outcome from a Decision element (like a discount exceeding a certain percentage), a designer can add an Approval Step to route the request to a manager where they can approve or reject the record.

          1. On the same flow, after the Discount > 25 outcome, click Add element iconto another Stage element.
          2. Specify these details.
            1. Label: Send for approval
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
            3. Condition: When all steps have been marked Completed, the state is marked Completed
          3. In the Send for approval element, click + Add Step.
          4. Select Approval Step and specify these details.
            1. Label: Approval discount greater than 25
            2. Click Tab to autopopulate the API Name. Or provide an API name that’s similar to your label.
            3. Condition: When the stage starts, the step starts
          5. Under the Select an Action to Run section, select the Evaluate Approval Requests action.
          6. Assign an approver by selecting the Approver Type as User and providing the user’s name. Users see this option only if they’ve enabled the Enable email approval response setting. Also, users must use recognizable keywords such as Approve or Reject, for the response to be processed.
          7. Under the Select the Record to Approve, specify these details.
            1. Record: recordId
            2. Optionally, select Use Smart Approvals to set automatic approvals.
          8. Finally, if you’ve set serial or parallel approvals, provide a chain name to ensure approvers can provide the approval sequentially or simultaneously.
          9. To complete the workflow, add another Decision element under the Send for approval Stage element to set outcomes if the discount is greater than 50%.
          10. Add a final approval stage element with an approval step, assigning it to the appropriate approver. Inside this step, set the completion condition to When the assigned user has completed the action, the step is marked Completed.
            Approval Step

          Finally, save the flow with the name Discount Threshold Approval; this exact name is essential as the integration layer will use it to invoke the flow.

           
          Loading
          Salesforce Help | Article