context-service

Inspect, author, deploy, and debug Salesforce Revenue Cloud Context Definitions and runtime instances.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Salesforce Revenue Cloud Context Definitions are the canonical data layer that pricing, expression sets, the configurator, DocGen, and billing bind to at runtime, but authoring, extending, activating, and debugging them involves a confusing split between Connect API and SObject REST endpoints, silent failure modes, and pilot-gated runtime APIs. This Skill gives an AI agent the routing rules, gotchas, helper scripts, and reference docs to perform those operations correctly. ## Core Features & Use Cases - Design-time authoring and lifecycle: Extend standard contexts, apply additive attribute/tag/mapping plans, validate plans offline, diff definitions across orgs, and deploy tracked contextDefinitions metadata via CCI tasks. - Runtime instance lifecycle: Build hydration payloads, hydrate instances from records, query values by tag, and persist attribute values back to mapped SObjects, with guidance on request-scoped contextIds and the Apex/Flow path for GA orgs. - Inspection and debugging: Describe, trace, diff, and export live definitions; diagnose blocked deactivations, phantom hydration writes, FLS-hidden bindings, and silently destructive PATCH behavior. - Use Case: You need to surface a new custom field to a pricing procedure. The Skill routes you to add an attribute plus tag plus mapping on the extended Sales Transaction context, lint the plan offline, dry-run it against the org, and verify with describe_context.py. ## Quick Start Ask the agent to inspect the RLM_SalesTransactionContext definition on your org and trace how a specific Quote field maps to a context tag using the helper scripts.

Frequently Asked Questions about context-service

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

FAQPage Schema
How do I extend a Salesforce Revenue Cloud context definition?

Run the extend_context_* CCI task (or extend_standard_context with name and baseReference) to add a custom layer on a standard base. Extended definitions auto-upgrade via Sync and preserve mandatory mappings, unlike cloned definitions.

How do I add a custom field to a pricing context in Revenue Cloud?

Add an attribute plus a tag plus a mapping rule to the existing node via an additive plan, then apply it with manage_context_definition. Lint the plan offline with validate_context_plan.py and dry-run before mutating the org.

Why does my context definition deactivation fail?

Deactivation is blocked while an active consumer such as an ExpressionSet, ContextRules, PricingActionParameters, or decision table references the definition. Query ExpressionSetDefinitionContextDefinition to find linked expression sets, unlink or deactivate consumers first, then deactivate.

Why does context hydration succeed but no data appears?

The most common cause is a businessObjectType set to the context-node name instead of the mapped SObject name, which silently hydrates zero records. Also verify the mapped field exists on the org and the running user has FLS, since missing FLS hides bindings from the Connect GET.

Can I use the runtime Context REST API on a normal GA org?

Not for multi-call sequences: query-record and query-tags are pilot-gated, and a REQUEST-scoped contextId does not survive across separate calls. On a GA org, run the full hydrate-query-persist lifecycle in one Apex transaction using Context.IndustriesContext or one Flow.

What are the limits for nodes and attributes in a context definition?

The offline validator enforces at most 30 nodes per definition, 50 attributes per node, 250 total attributes, and hierarchy depth of 5. Salesforce Help quotes higher ceilings, but the strict validator numbers are the safe authoring target.