Case classification is a high-frequency automation requirement for Service Cloud customers. Traditionally solved with Einstein (Predictive) Case Classification, many organisations are now seeking generative AI approaches — often triggered by limitations of the predictive model or a desire to unify classification with an Agentforce strategy. When using AI for case classification, there are multiple architectural options to consider. This article summarises the available options and outlines key considerations.
Before you start: Regardless of approach, case hygiene is a prerequisite. For options that use previous case data, low case hygiene will directly degrade classification accuracy. Maintaining a limited, relevant set of classification options is key to achieving good results.
How it works: Uses a trained Machine Learning (ML) model to predict field values based on historical case data. When your model is active, Einstein predicts the value of every field selected in your model. The model re-trains over time based on agent feedback (acceptance/rejection). Human oversight is optional.
When to use: Classification taxonomy is relatively stable and not too large; historical case data is sufficient and high-quality for model training; no need for team-level or queue-level classification filtering.
Setup: Autofill Case Fields with Einstein Case Classification; Case Classification for Flows
Key considerations:
How it works: A Record-Triggered Flow runs on case creation or case update, calls a Prompt Template via the Generate Prompt Response Flow core action, the LLM returns a structured classification result, Apex parses the JSON data returned by the Prompt Template, and the Flow writes classification fields back to the Case record. The same workflow can also be triggered from an agent action or during case escalation.
When to use: Automated, background classification triggered immediately after case creation or case update; classification taxonomy is manageable in size; no human oversight is required.
Setup: Using Prompt Builder, Flows, and Apex to Summarize and Classify Cases Faster
Key considerations:
Example Prompt Template Pattern:
You are an expert AI classification assistant.
Analyze the case and determine the core reason for contact.
### Classification Table (merged dynamically into the prompt)
| Type | Subtype | Description |
|--------------|-----------------|--------------------------------------------|
| Billing | Invoice Request | Customer wants a copy of a past invoice... |
| Tech Support | Login | Customer is locked out... |
...
### Instructions
1. Read the case content carefully.
2. Select the single best-matching Type and Subtype.
3. If insufficient context, output "Uncategorized" for both.
### Output Format
Return ONLY valid JSON:
{ "Type": "...", "Subtype": "...", "Confidence_Score": [1-10] }
### Input
{!$Input:Case_Description}
{!$Input:Case_Subject}
How it works: Rather than using a Large Language Model to select the best classification, this approach uses the semantic search capability of the Data Cloud Search Index as a pure signal — no generative AI is involved. A Record-Triggered Flow fires on case creation and calls an Apex class. The Apex class executes a Data Cloud Query against the Case Search Index, passing the new case's Subject and/or Description as the search string. The query returns the top N semantically similar historical cases, including their classification fields (e.g. Type, Sub_Type__c). The Apex code then performs a majority vote — tallying the most frequently occurring classification values across the returned results — and writes the winning values directly back to the triggering Case record. No prompt template, no LLM call, and no Einstein Request credit is consumed.
For full details on this approach, see Agentforce and RAG: Best Practices for Better Agents (Section 13.3: Non-Generative Use Cases).
When to use: Classification taxonomy is stable and well-populated in historical data; LLM credit consumption needs to be minimised or avoided entirely; real-time, synchronous classification is required but generative AI is not approved or not available; a "most common answer wins" heuristic is acceptable as the classification logic.
Key considerations:
How it works: A custom Machine Learning (ML) classification model trained and hosted in Data Cloud. With AI Models, you can use multi-class classification to predict the likelihood that records fall into one of 3 to 50 buckets. Training data is ingested into Data Cloud, a model is trained in the AI Models tab using Data Cloud compute, and predictions are surfaced via Flow integration or Predict API.
When to use: A custom ML model with full control over training data and features is required; large-scale classification needs where a rules-based or generative approach is impractical.
Setup: Classification with Data Cloud; Multiclass Classification; Topic Classification; Use Outputs from Predictive Models
Key considerations:
The table below provides an overview of the available options. When selecting an approach, consider additional factors such as retrieval latency, maintenance effort, credit consumption, and the limitations documented for each option.
Option |
Uses GenAI |
Uses Agentforce |
Billing |
Complexity |
| 1 — Predictive Case Classification | No (ML) | No | Included in Service Cloud; no per-case credit cost | Low (Setup, Flows) |
| 2 — Flow + Prompt Template / LLM | Yes | Optional | Flex credits; scales with case volume and prompt size | Medium (Flows, Apex, Prompt Templates) |
| 3 — Majority Vote (Search Index) | No | No | Data Cloud Query credits; scales with case volume | Medium (Flows, Apex, Data Cloud Queries) |
| 4 — Data Cloud AI Model Builder | No (ML) | No | Data Cloud credits for training and scoring; scales with data volume | High (Setup, Model Selection, Quality Assurance, Model Maintenance, Flow, Data Cloud Queries) |
005389632

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.