Salesforce

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.

Overview

This integration connects Salesforce with Corules's policy enforcement runtime. Your existing Salesforce workflows call Corules's REST API (or MCP server) to enforce policy constraints before any business action completes.

All policy logic stays in Corules — your Salesforce configuration only needs to call the endpoint and route based on the ALLOW / BLOCK / ESCALATE response.

Setup steps

  1. 1

    Configure Corules use case 'quote_approval' with approval routing parameters (thresholds per segment × value × product)

  2. 2

    Add Named Credential for Corules API in Salesforce Setup

  3. 3

    In CPQ, add a before-submit Apex trigger that calls Corules Gate 1 to retrieve the required approver level

  4. 4

    Map the returned constraint (required_approver_level) to Salesforce Approval Process entry criteria

  5. 5

    On approval completion, call Corules Gate 2 to log the final decision with approver identity

Code example

The following snippet shows how to call Corules from Salesforce. Replace YOUR_USE_CASE_ID and YOUR_API_KEY with your tenant credentials.

// 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
  }
}

Language: json

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.

Connect Salesforce to Corules

Start free — integration templates are available on every plan.

Get started free