DiscoveryStory defines the data and analytical settings that Einstein Discovery uses to generate insights and build predictive models. It identifies the source data, selected outcome field, optimization goal, and analysis preferences. Package Manager lists this type as "Discovery Story". It represents the story configuration, not merely a predictive model's label.
Write operations for DiscoveryStory are generally not supported. Its presence in Package Manager or a retrieved metadata package does not establish support for creating or updating stories through Metadata API deployment.
Key Elements
| Element | What the Element Controls |
|---|---|
application |
Required. Identifies the associated CRM Analytics app through a reference to WaveApplication. |
sourceContainer |
Required. The source ID, not a developer name. It has a recognized reference to WaveDataset and must be interpreted together with sourceType. |
sourceType |
Required. Identifies how the source is supplied. Allowed values are AnalyticsDataset, LiveDataset, and Report. |
outcome |
Required. Contains the selected outcome settings for the story. |
outcome.field |
Required. Selects the target field that the story analyzes or predicts. |
outcome.goal |
Required. Sets the optimization goal to Maximize, Minimize, or None. |
outcome.type |
Required. Sets the outcome type to Categorical, Count, Number, or Text. |
label |
Required. The story's descriptive label. If the story is packaged, this label appears in Package Manager. |
outcome.label |
Required. The descriptive label for the selected outcome; it does not select the target field. |
autopilot |
Optional. Sets the story's autopilot status to Enabled or Disabled. |
classificationThreshold |
Optional. A numeric threshold for classification predictions. |
validationContainer |
Optional validation ID as exposed by metadata tooling. The official field table instead spells this element validationContainder; the naming discrepancy is discussed below. |
Behavior and Constraints
The source, outcome field, outcome type, and goal together define what the analysis is intended to explain or optimize. Neither the story label nor the outcome label substitutes for these settings.
Interpret sourceContainer together with sourceType. Although sourceContainer has a recognized dataset reference, the allowed source types also include LiveDataset and Report. Do not treat every story as having the same kind of source.
Salesforce defines outcome as a required selected outcome. Some metadata tooling exposes it as an array, but that representation alone does not establish support for multiple selected outcomes.
The documented value restrictions still apply when tooling represents an element as a string. In particular, autopilot accepts Enabled or Disabled, and the outcome goal and type use the values listed above.
Deployment and Retrieval
A story is stored in the discovery folder as two matching files:
-
ModelName.storycontains the story's actual data. -
ModelName.story-meta.xmlcontains the story's metadata.
The metadata XML alone is not the complete story representation. When examining a retrieved story, account for both files rather than treating the metadata file as the entire asset.
Use DiscoveryStory as the type name in package.xml. The manifest supports named members and the wildcard *. Manifest support and the two-file representation do not override the general restriction on write operations; neither is evidence of general support for creating or updating stories through deployment.
Relationships
The app and source references connect a story to its analytical context. They do not establish that the story owns the app or dataset. The source reference must also be read in the context of sourceType.
References
-
WaveApplication:application -
WaveDataset:sourceContainer
Documentation Inconsistencies
- The published example uses
Numericalforoutcome.type, but the documented allowed values listNumberas the numeric value.Numericalis not listed as an allowed value. - The official field table spells the optional validation ID element
validationContainder, while metadata tooling exposesvalidationContainer. This discrepancy matters when diagnosing an unrecognized element; it does not establish that both spellings are supported.
Common Questions
Can I deploy a DiscoveryStory through Metadata API?
Write operations are generally not supported. A story appearing in Package Manager or a retrieved package does not establish general support for creating or updating it through Metadata API deployment.
Why does a DiscoveryStory have both a .story file and a .story-meta.xml file?
The .story file contains the actual story data, while the matching .story-meta.xml file contains metadata. Both belong in the discovery folder, and the metadata XML alone is not the complete story.
Is sourceContainer a dataset developer name?
No. sourceContainer is a source ID, not a developer name. Interpret it together with sourceType, which accepts AnalyticsDataset, LiveDataset, or Report.
Should outcome.type use Number or Numerical?
Number is the documented numeric value. The published example uses Numerical, but that value conflicts with the documented allowed values.