Salesforce Quote Approval with Multi-Tier Policy Routing
Route Salesforce CPQ quotes through the correct approval chain based on Corules policy — customer segment, quote value, and product type — without maintaining complex approval matrices in Salesforce Process Builder.
Le problème
Route Salesforce CPQ quotes through the correct approval chain based on Corules policy — customer segment, quote value, and product type — without maintaining complex approval matrices in Salesforce Process Builder.
Étapes de configuration
- 1
Configure Corules use case 'quote_approval' with approval routing parameters (thresholds per segment × value × product)
- 2
Add Named Credential for Corules API in Salesforce Setup
- 3
In CPQ, add a before-submit Apex trigger that calls Corules Gate 1 to retrieve the required approver level
- 4
Map the returned constraint (required_approver_level) to Salesforce Approval Process entry criteria
- 5
On approval completion, call Corules Gate 2 to log the final decision with approver identity
Exemple de code
// Gate 1: get required approver level before submitting quote
{
"use_case": "quote_approval",
"actor": "{{ SalesUserId }}",
"context": {
"quote_value": 185000,
"customer_segment": "enterprise",
"product_type": "platform_license",
"is_existing_customer": true
}
}
// Response: constraint on required approval level
{
"constraints": {
"required_approver_level": "director",
"max_quote_discount_pct": 0.15,
"required_legal_review": false
}
}Frequently Asked Questions
How is this different from Salesforce Approval Processes?
Salesforce Approval Processes encode logic in UI-configured criteria that are hard to audit and change. Corules externalizes the routing logic into versioned CEL policy — auditable, testable, and changeable without Salesforce admin access.