Skip to main content
The Trailblazer Community in Slack is now in Open Beta—join and connect in real time. Join us in Slack

Build a Discount Approval Workflow

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain the role of the Fetch Quote Details flow in an approval workflow.
  • Create an Autolaunched Flow Approval Process in Flow Builder.
  • Add an approval stage to your approval workflow.
  • Define entry conditions to trigger approval steps.

Plan Your Approval Journey

Before diving into the technical configuration of your discount approval workflow, it’s essential to understand the organizational goals driving these changes. A well-planned approval process not only ensures compliance and consistency but also empowers your sales teams to operate efficiently. By clearly defining your business requirements upfront, you create a robust structure that minimizes friction and maximizes productivity. This preparatory phase is a critical step in setting up a scalable and reliable automation framework. With this foundation in place, let’s explore the scenario that guides our hands-on implementation.

A Business Scenario

As a fast-growing electronic product and solution provider, InfintraBytes operates in a highly competitive market. To win bids and close deals, sales representatives frequently apply discounts to their customer quotes. However, the company recently noticed a dip in profit margins due to unauthorized, high-percentage discounts being applied to quotes. To protect margins while keeping the sales cycle fast, InfinitraBytes has decided to implement a strict, automated, and multi-tiered quote discount approval process.

Jordan Lee (he/him), who serves as both the approval designer and admin at InfintraBytes, is leading this deployment. The corporate compliance board has established a three-tiered routing enforcement matrix for Jordan to build. Here’s the approval logic.

Approval Condition

Required Approver

Approval Chain Name

Compliance approval for quotes with any discount value specified

Legal Specialist

Legal Team (Parallel)

Sales approval for quotes with discounts greater than 25%

Sales Manager

Sales Team (Sequential)

Sales approval for quotes with discounts greater than 50%

Sales SVP

Sales Team (Sequential)

This critical work lays the foundation for a robust, automated approval framework that ensures compliance and protects your margins.

Next, let's get you set up with a dedicated environment so you can begin building.

Launch a Developer Edition Org with Advanced Approvals

To complete this badge, you need a custom playground that contains the Approvals app and our sample data.

  1. Click Create Playground, and then click Yes, Create Playground.
  2. Your new org is automatically attached to your Trailhead account.
  3. Make note of your org's expiration date and complete this badge before then.
  4. Click Launch to open the playground.

Enable Pricing

Now that your org is connected, follow these steps to make sure it’s ready to use.

  1. From Setup, in the Quick Find box, find and select Salesforce Pricing Setup.
  2. Under the Sync Pricing Data section, select Sync.

The Sync Pricing Data section on the Salesforce Pricing Setup page, with the Sync button highlighted.

  1. Confirm that you want to sync your org.

The pricing data sync takes a few minutes to complete, but you don’t have to wait. Proceed to the next section.

Retrieve Quote Record Details

Before an approval workflow can route a quote to the right approver, it needs specific context such as the total discount percentage. When a quote is submitted for approval, the workflow knows an event occurred, but it doesn't automatically have access to all the quote's field values. It needs a way to retrieve that data.

Advanced Approvals bridges this gap by using a subflow that acts as a data retrieval utility. Here's how it works.

  1. The main approval workflow passes the QuoteId to the subflow.
  2. The subflow queries the database to retrieve that specific quote record.
  3. It then returns the complete quote data, including all field values, back to the main workflow.

Good News! Your Developer Edition org already includes an activated Fetch Quote Details subflow. Now you can focus on building the main approval flow while the subflow takes care of retrieving the required data.

The Fetch Quote Details subflow.

In the next section, you use this subflow to set up your approval flow.

Create an Approval Workflow

With the background data services in place, Jordan moves on to create a discount approval workflow by using the flow approval process. Follow along.

  1. From the App Launcher, find and select Approvals.
  2. From the Approvals Home page, select Create Flow Approval Process.
  3. Select Start from Scratch. A new canvas for an Autolaunched Flow Approval Process (No Trigger) opens in a separate workspace window.

A new Autolaunched Flow Approval Process (No Trigger).

  1. On the Flow Builder canvas, select Add element.and select the Stage element.
  2. Add these details:
    • Label: Get quote record
    • The API Name should auto-populate as Get_quote_record.
    • Condition: When all steps have been marked Completed, the stage is marked Completed
  3. Close the Stage element.
  4. In the Get quote record stage, select + Add Step.
  5. Select Background Step, and add these details:
    • Label: Get quote record for record id
    • The API Name should auto-populate as Get_quote_record_for record id.
    • Condition: When the stage starts, the step starts
  6. Under the Select an Action to Run section, add these details:
    • Action: Fetch Quote Details
    • InputQuoteID: recordId
  7. Select Save.
  8. On the Save the orchestration pane, add your approval flow details:
    • Flow Approval Process Label: Discount Threshold Approval
    • The API Name should auto-populate as Discount_Threshold_Approval.
    • Description: Quote discount approval workflow
  1. Save your work.
  2. Close the background step.

The Background Step Properties.

Your approval flow can now retrieve the quote record details needed to evaluate discount thresholds.

Add an Approval Stage

Now it's time to add the core approval logic that brings InfintraBytes' three-tier discount approval policy to life. Follow along as Jordan adds a stage element and configures the first approval step in the Discount Threshold Approval flow.

  1. Select Add element. below the Get quote record stage and select the Stage element.
  2. Add these details:
    • Label: Quote Discount Approval
    • The API Name should auto-populate as Quote_Discount_Approval.
    • Condition: When all steps have been marked Completed, the stage is marked Completed. For now, let this be selected. You’ll update this to a custom exit condition in the next unit.
  3. Close the Stage element.

You've added the stage element. Next, configure the first approval step based on the routing logic.

InfintraBytes requires compliance review from the Legal team for any quote carrying a discount. This approval step runs in parallel with the sales approval chain. Time to configure it.

  1. On the Quote Discount Approval stage, select + Add Step.
  2. Select Approval Step, and add these details:
    • Label: Quote Discount > 0
    • The API Name should auto-populate as Quote_Discount_0.
  3. Under Select When to Start the Step, add these details:
    • Condition: When the specified requirements are met, the step starts
    • Requirements to Start Step: All Requirements Are Met (AND)
    • Resource: Get quote record > Get quote record for record id > Outputs > FetchedQuoteRecord > Discount
    • Operator: Greater Than
    • Value: 0. This condition ensures the step triggers only when the quote discount exceeds zero.

Requirement configuration showing discount greater than 0.

4. Under Select an Action to Run, select Approvals Workflow: Evaluate Approval Requests.

5. Under Select the Approver, make sure User is selected for Approver Type and select OrgFarm EPIC as the User.

6. Under Select the Record to Approve, complete these actions:

  • For Record ID, select recordId.
  • Uncheck the Lock the record checkbox.
Note

Although this badge introduces multiple business personas and their responsibilities, learners complete all approval reviews using a single System Administrator login. The OrgFarm admin account uses the Flow Orchestration Work Guide to simulate each approval role, eliminating the need to switch user accounts while still demonstrating the complete approval process.

  1. For Approval Chain Name, enter Legal Team.
  2. Under Select When to Complete the Step, select When the assigned user has completed the action, the step is marked Completed.

The Quote Discount > 0 approval step with all required fields in place.

  1. Close the Approval Step.
  2. On the Flow Builder canvas, select Save.
Note

You may see some warnings. These won't affect your approval workflow, so you can safely ignore them.

Your first approval step is configured and ready to route discounted quotes to the Legal team for compliance review.

Next Up

You’ve successfully built the approval framework, configured data retrieval, added the approval stage, and set up the first approval step. In the next unit, you configure the remaining approval steps and complete your workflow. Stay tuned!

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback