expression-sets

Inspect and author Salesforce Revenue Cloud BRE Expression Sets via Connect and Metadata APIs.

5|3|Updated Sep 9, 2026
One-click install
npx skills add https://github.com/SalesforceLabs/revenue-cloud-foundations --skill expression-sets-salesforcelabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expression-sets
Source: https://github.com/SalesforceLabs/revenue-cloud-foundations/tree/main/.cursor/skills/expression-sets
Command: npx skills add https://github.com/SalesforceLabs/revenue-cloud-foundations --skill expression-sets-salesforcelabs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Editing Salesforce Revenue Cloud Expression Sets (pricing, rating, qualification, and discovery procedures) programmatically is error-prone: Connect API payloads are HTML-escaped, active versions cannot be modified, step graphs are flat with per-parent sequence numbers, and a structurally valid change can still silently misprice transactions. This Skill encodes the live-verified rules, mutation lifecycle, and tooling needed to read, author, overlay, and activate Expression Sets safely. ## Core Features & Use Cases - Programmatic CRUD via Connect or Metadata API: Export, create, replace, overlay, activate, and delete Expression Sets with the deactivate → modify → reactivate lifecycle, HTML-entity normalization, and verb-specific field rules handled automatically. - Declarative overlay authoring: Capture known-good steps from a live org into validated addSteps/removeSteps overlays with the three dependency scopes (version variables, custom external dependencies, standard context) pre-classified. - Inspection and visualization toolkit: List, describe, trace variable producers/consumers, diff org-vs-org, and render Mermaid dependency or execution-flow diagrams of any procedure. - Use Case: You need to add a discount step to a pricing procedure. Export the shipped RLM_DefaultPricingProcedure, slice the step into a validated overlay, preview the apply against a disposable clone, then confirm — with labels preserved and the version reactivated. ## Quick Start Ask the agent to list the Expression Sets in your org by type, then export and trace a variable in the default pricing procedure using the scripts/expression_sets toolkit with your SF CLI org alias.

Frequently Asked Questions about expression-sets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a Salesforce Expression Set programmatically?

Use the Connect API tasks or the scripts/expression_sets toolkit to export the definition as JSON, modify it, then import or apply an overlay. Every mutation runs deactivate, PATCH or POST, then reactivate, with HTML-entity normalization applied automatically.

Connect API vs Metadata API for Expression Set authoring?

Use the Metadata API (expressionSetDefinition XML plus deploy) for source-controlled, git-tracked changes, and the Connect API for runtime CRUD and org-to-org capture. Step, parameter, and variable shapes are identical across both paths, so a step authored once works for either.

Why does my Expression Set PATCH fail with a syntax error?

Raw Connect GET output is HTML-escaped, and sending it back unmodified makes the engine reject the entities with errors like 'Syntax error. Found &'. HTML-unescape the payload before any PATCH or POST; the provided tasks do this by default via normalize_html_entities.

Can I modify an active Expression Set version?

No, an enabled version cannot be modified or deleted. The tooling deactivates the version (and any referencing procedure plan), applies the change, then reactivates; a failed mutation is left deactivated and raised for inspection.

Does this skill work for Constraint expression sets?

No. Constraint sets are authored in CML (Constraint Modeling Language) and shipped as a plain-text blob, not a step graph, so the overlay tooling and step model do not apply. Use the constraint-models skill for those.

Why did my step labels disappear after a Connect import?

Connect has no label field, so a full-graph PATCH resets every label to its API name. The import and overlay tasks capture and restore labels automatically via a second Tooling API cycle, or you can run relabel_expression_set.py last.