Enrichments
An enrichment adds data no field, related list, metric, or formula can produce. It runs a source — your code, an existing action, a flow — and renders the result as values (labeled scalars, “Open Pipeline Coverage: 2.4x”) or records (a table in the target object’s curated list columns).
How it works
An SObject or list renders as a records table, a multi-line string as a block, anything else as a value. A single output takes the element’s label; several take theirs from their variable names.
ContextWorks re-queries records outputs as the calling user, so a payload never shows a row the caller could not query. → Enrichment output
Choose a source type
Studio → Enrichments → New Enrichment opens a chooser:
| Source | What it mounts | Status |
|---|---|---|
| Apex Provider | A class implementing EntityEnrichmentProvider | Available |
| Invocable Action | Any existing @InvocableMethod, unchanged | Available |
| Flow | Any active autolaunched flow, unchanged | Available |
| Data 360 | Declarative queries over Data 360 objects | Planned |
| External Objects | OData-backed __x objects | Planned |
You can’t change the source type after the first save; create a new enrichment instead.
NOTE
Until the declarative Data 360 source ships, an Apex class that queries DMOs registers as an ordinary Apex Provider. DMO reads aren’t governed by CRM sharing. → Security
Apex Provider
The Provider class field lists every class in the org implementing the interface. Enter a class from another namespace manually, as ns.ClassName. Show example provider class on the Definition tab expands the full contract with a working sample.
Save verifies the class exists, constructs with no arguments, and implements the interface. A typo fails the save, not the first render.
→ Provider SPI reference · Worked example
Invocable Action
Mounts any existing @InvocableMethod unchanged — org-local, ISV, or managed. Pick the action and wire it:
| Setting | What it does |
|---|---|
| Input parameter that receives the record Id | Which parameter gets the record being assembled |
| Outputs to include | Which declared outputs render |
| Records target object | Only used when a selected record-collection output comes back empty |
Managed classes hide their bodies, so cross-namespace actions fall back to free-text wiring.
With nothing checked, only result (or the sole output) renders. Invocable DTOs often carry plumbing like success and errorMessage that shouldn’t reach agent context.
Flow
Mounts any active autolaunched flow, unchanged. Save checks those requirements. Variable shapes come from platform metadata, so managed flows wire cleanly.
With nothing checked, all outputs render — the flow’s author already curated them. ContextWorks always filters out platform plumbing.
Set the minimum level
Enrichments default to detailed. A source costs a query per record, so it runs only on the full 360. Lower the level only for a source you know is cheap.
Preview and add to an entity
Preview on the Enrichments table runs an element against a real or sampled record, and shows what it renders, or a structured reason nothing did.
Add an enrichment to an entity from the element’s Where Used tab, or with + Add Enrichment on the canvas. An empty dropdown means everything applicable is already added, or nothing applies — check Available For.
Error handling
A source that throws never breaks the payload. The engine drops that element’s items and records an element_failure on Issues.
Don’t swallow exceptions in your provider. A loud failure with a clear message beats a silently empty section.