We thought we were finally getting an update to CPQ but according to Adam White it will be hidden when the update gets released. I’ve created a pre-release org but I wasn’t able to see the flow component in there either.


So no update but it did get me thinking that I might be able to get that function working by leveraging the CPQ API. I wanted to make sure we could use a Salesforce Flow to add products to a quote quicker. I did get it working and got a massive 45% time saved on adding products to quote (verified through Randomized controlled trials).
The Solution

Now I just said flow and Salesforce CPQ which should catch your attention if you know CPQ.
First rule of fight club CPQ, you don’t add/edit quote line values with platform automations AKA flows. If you want to do something beyond what you can do with price rules/product rules, you’d want to use javascript and a quote calculator plugin.
The idea for this solution was to leverage a ‘Low-Code’ solution where you can build with all the advantages of flows and use a portion of code as an apex action to leverage the CPQ API. The flow handles logic and filtering and the apex class adds the products to the quote and saves/calculates the quote,
I’m not a developper so don’t take my word for it but I tested the flow along with the apex action multiple times with different volumes and didn’t run into any issues.
The code for the Apex Class is available at the bottom of this post. I’ve created 2 flows to go along with the Apex Class.
- The first one allows for the creation of the quote and the option to quick add products right away and would be used as a screen flow on the Account/Opportunity lightning page.
- The second flow is meant to help add products to a quote from the Quote lightning page without loading the ‘Edit Lines page.
Flow 1 – Create Quote and add products

- This flow opens with a screen that lets you select your quote default values, pricebook selection and a decision to add products which will drive the following steps.

- Once your selections are made, the quote gets created and depending on the selection you are taken to the product selection screen.
- Before the product selection screen a couple additional steps
- Get all products that can be quoted (Modify to your requirements, I used ‘Active’ = TRUE and ‘Component’ = False
- Add the products to a collection variable
- Get the pricebook entries based on the quote’s pricebook and whether the productid is in the collection we created at the previous step.




- Product selection screen let’s you select from the Pricebook entries that were returned in your record queries.
- Once your selections are made, click next and the Apex class leverages the CPQ API to read the list of products along with the currency of the quote and the pricebook. The returned product models are added to the quote and finally the quote is saved and calculated.
- Note that there is a delay as the calculation is done Async
From the documentation
Calculate Quote API performances handles calculations similarly to the speed of asynchronous calculations in Salesforce CPQ. We do not recommend using it for processes that require instant calculation.
Flow 2 – Product Quick Add
This flow would live on the quote record page. It allows you to add products to the quote without loading the line editor.

The flow itself is built in a very similar way as the quote creation flow but it, obviously, avoids the quote creation portion of the flow. The products are retrieved using the same logic and you’re taken straight to the product selection page.

Conclusion
Congratulations on making it this far.
I think the apex action could provide interesting value, flexibility and extra options in designing the user experience for CPQ users.
If you take a look at the Apex Action you’ll see that it allows you to pass additional field value in it’s current form (List Price, Quantity, Discount) and it could be modified to accept more. A prior version I tested allowed a user to enter a quantity and a discount before the product was added to the quote.
Apex Class
In the provided Apex code for adding a product to a Salesforce CPQ quote, several custom classes serve as dependencies that you’ll need to implement for the code to function correctly.
The QuoteReader class is responsible for fetching quote details and returning a QuoteModel. Similarly, the ProductReader class retrieves product information based on given IDs and currency codes, also returning a ProductModel.
The ProductAdder class takes these models to add the product to the quote, while QuoteSaver saves the updated quote.
Finally, QuoteCalculator performs calculations on the saved quote. For more information on Salesforce CPQ’s standard objects and fields, you can refer to the official Salesforce CPQ documentation.