MLPredictionDefinition defines a prediction within a parent AIApplication. It specifies the model category that returns prediction values, the configured prediction status, the field the prediction is based on, and the field that receives prediction scores. An AIUsecaseDefinition can consume the definition through its predictionDefinition element.
The prediction definition is configuration, not proof that scoring is running. Its parent application reference, prediction field, and score-destination field serve different purposes and are not interchangeable.
Key Elements
| Element | What the Element Controls |
|---|---|
aiApplicationDeveloperName |
Required. References the parent AIApplication by developer name, its API-facing name, not by record ID. |
developerName |
Required. The prediction definition's unique developer name. Naming and field-access restrictions apply. |
fullName |
The component name inherited from the base Metadata type. Keep this distinct from the parent application reference. |
masterLabel |
The label displayed for the prediction definition in the Salesforce user interface. It does not identify the parent application. |
predictionField |
References the CustomField on which the prediction is based. |
pushbackField |
References the CustomField that receives prediction scores. Changing it changes the configured score destination, not predictionField. |
status |
Required. Accepts Enabled, Disabled, or Draft. These are configured states; they do not by themselves establish that scoring is occurring. |
type |
Required. Selects the model category returning prediction values: BinaryClassification, MulticlassClassification, Regression, ScoringSpecificOutcome, LanguageDetection, DeepLearningIntentClassification, DeepLearningNameEntityRecognition, GlobalDeepLearningIntentClassification, or GlobalDeepLearningNameEntityRecognition. |
priority |
An integer expressing priority when the parent application has multiple child prediction definitions. It can be unset. The field alone does not establish numeric precedence or an execution sequence. |
positiveExpression |
An MLFilter structure reserved for future use. Do not treat it as supported active prediction criteria. |
negativeExpression |
An MLFilter structure reserved for future use, with the same restriction as positiveExpression. |
Behavior and Constraints
Developer names have strict syntax. Both aiApplicationDeveloperName and developerName must begin with a letter and contain only alphanumeric characters and underscores. Neither can contain spaces, end with an underscore, or contain consecutive underscores. The parent application developer name and the prediction definition developer name must each be unique within their respective org scope.
Access to developerName is permission-controlled. Only users with either View DeveloperName or View Setup and Configuration permission can view, group, sort, and filter that field. This restriction concerns access to the field; it does not establish authorization to run predictions.
Priority is not a documented execution schedule. An application can have multiple child prediction definitions, and priority expresses their priority. Do not assume that a lower or higher number runs first, or infer an execution sequence from the value alone.
The expression structures are reserved. Although positiveExpression and negativeExpression expose operators, typed values, and lhFilter and rhFilter nodes that can contain further filters, those structures are not supported active prediction criteria. Their nested lhPredictionField and rhPredictionField elements can reference CustomField metadata. Those references identify structural dependencies, not evidence that the expressions execute.
Deployment and Retrieval
MLPredictionDefinition components use the .mlPrediction suffix and are stored in the mlPredictions folder. The type supports * as a wildcard in package.xml, the manifest file that selects metadata components for deployment or retrieval.
When preparing a definition, supply the required aiApplicationDeveloperName, developerName, status, and type elements. Use the parent's developer name rather than a record ID, and preserve the exact spelling of the allowed status and model-category values.
Distinguish the parent application dependency from the field dependencies and consuming use cases. These relationships do not by themselves establish a mandatory deployment order or a deletion cascade. In particular, a reference from a use case does not establish that deleting the prediction definition also deletes that use case.
Relationships
The main connection runs from a consuming AIUsecaseDefinition, through predictionDefinition, to this definition, then through aiApplicationDeveloperName to the parent AIApplication. Field references separately identify the field being predicted and the field receiving scores.
References
-
AIApplication:aiApplicationDeveloperName. -
CustomField:predictionField,pushbackField, and the nestedlhPredictionFieldandrhPredictionFieldelements within the reserved expression structures.
Referenced By
-
AIUsecaseDefinition:predictionDefinition.
Common Questions
How do I retrieve all MLPredictionDefinition components?
Use the MLPredictionDefinition type with the * wildcard in package.xml. Components use the .mlPrediction suffix in the mlPredictions folder.
What is the difference between predictionField and pushbackField?
predictionField identifies the field the prediction is based on. pushbackField identifies the field that receives prediction scores. Changing the score destination does not change the field being predicted.
Does status Enabled mean predictions are running?
No. Enabled is a configured prediction state. The definition alone does not establish that scoring is occurring.
Can I use positiveExpression or negativeExpression to filter predictions?
Do not treat either element as supported active prediction criteria. Both are reserved for future use, even though their exposed structures contain operators, values, nested filters, and field references.
Does aiApplicationDeveloperName accept an application record ID?
No. It requires the parent AIApplication's developer name. That name must follow the documented naming rules; masterLabel is the prediction definition's user-interface label, not a substitute for the parent reference.