PriyamvadhaM
ServiceNow Employee

Automatically triage, research, and manage complaint cases end-to-end through a coordinated team of specialized AI Agents

 

Accelerate Complaint Case Handling is an agentic workflow that orchestrates three specialized AI Agents to process complaint cases from creation through resolution research; without requiring manual intervention at each stage. When a complaint case is created or moves into review, the workflow automatically selects and invokes the appropriate agent based on case state, routes between agents as the case progresses, and ensures each agent completes its task before handing off to the next.

 

What are the AI agents in this workflow (out-of-the-box)?

 

To achieve this, the orchestrator comprises of 3 AI agents out-of-the-box (Complaint Case Triage Agent, Complaint Case Research Plan Agent, Record Management AI Agent) and determines which agent to invoke: Triage for newly created cases, Research for cases under active review, and Record Management for record-level operations based on case state, complexity factors, and historical resolution patterns. This reduces the coordination overhead that would otherwise fall on human case handlers.

 

Key Capabilities: Which agent does what

 

  • Complaint Case Triage Agent automates triage: When a complaint case is created, the Triage Agent automatically derives category, subcategory, and priority from the case content without asking the CSR (human agent) for input.

  • Complaint Case Research Plan Agent provides research-driven resolution recommendations: When a case moves to 'Under Review', the Research Plan Agent searches similar closed cases and knowledge articles, filters out already-attempted steps, and surfaces the top three most relevant next-best suggestions with source attribution.

  • The Research Plan Agent also analyzes task patterns from similar closed cases and recommends a structured plan of up to five case tasks, checking for semantic overlap with existing tasks before creating new ones. 

  • Duplicate detection before task creation: Before creating new case tasks, this agent checks existing tasks on the current complaint case and only proposes tasks that don't semantically overlap with what is already present.

  • Record Management AI Agent: It handles fetch, create, update, related record updates, KB article linking, and attachment operations for any task record within the workflow. Note that this is an already existing platform level AI agent that's being leveraged for this agentic workflow.

     

Other capabilities of this agentic workflow: 

 

  • Intelligent orchestration between agents: The workflow uses trigger conditions on case state to activate the correct agent at the right time: Triage fires on record creation, Research fires on update to Under Review. 

  • Work notes updated at every stage: Both the Triage and Research agents write structured work notes to the complaint case record documenting their actions, field updates, and recommended steps, giving case handlers full visibility into what each agent did.

 

What tools does each agent use: A snapshot

 

Agent

Type of tool

Tool

Execution mode

Complaint Case Triage Agent

Script

Category and subcategory choices

Autonomous

Update fields

Update work notes

Sub-flow

Get case details using number and fields

Autonomous

Complaint Case Research Plan Agent

Script

Update work notes

Autonomous

Create case tasks

Get case task details

RAG

Get Similar complaint cases and Relevant Knowledge articles

Autonomous

Sub-flow

Get case details using number and fields

Autonomous

Record Management AI agent

Script

Attach Knowledge Article to Task

Autonomous

save activity notes

Get Task Tables

Get Fields from Table

Get Attachment Details

Sub-flow

Update the record details

Autonomous

Update related records

Get the record metadata

Create the record

Copy Attachment to Record

Supervised

Get Related Lists

Autonomous

 

Further details on these tools are provided in the section 'Details of registered tools by agent'.

 

Pre-requisites for implementation

 

  1. The Accelerate Complaint Case Handling agentic workflow ships within the Now Assist for Complaint (CSM) app. Ensure this is installed and activated. Explore the docs site for further info.

  2. Confirm that category, subcategory, and priority choice values are configured in sys_choice for the sn_complaint_case table. The Triage Agent depends on these values to classify cases. Missing or misconfigured choices will cause the agent to terminate without updating the record.

  3. Ensure the AIA RAG Retriever search index is configured and includes both closed complaint cases and knowledge articles relevant to your complaint taxonomy. The Research Agent's recommendations are sourced from this retriever; it will not fabricate steps.

  4. Test the full workflow end-to-end: create a complaint case in New state and verify that the Triage Agent fires, updates category/subcategory/priority, and writes work notes. Then move the case to Under Review and verify the Research Agent fires and produces recommendations.

 

How It Works

 

The workflow uses two record-based triggers on the sn_complaint_case table to activate the appropriate agent at the right time:

 

  • A new complaint case is created with state = New (1). The Triage Trigger fires and invokes the Complaint Case Triage Agent.

  • The Triage Agent retrieves case details, fetches all applicable category and subcategory choices filtered by complaint type, derives the correct values from the case content, determines priority based on business impact analysis, updates the record, and writes a structured work notes summary.

  • Once the case handler reviews the case and moves it to Under Review (state = 20), the Research Trigger fires provided the case has a non-empty short description and is assigned to a human agent (not the AI placeholder user).

  • The Research Plan Agent retrieves the full case record, extracts all previously attempted troubleshooting steps from the description and work notes, searches similar closed complaint cases and knowledge articles via the RAG Retriever, filters out semantically duplicate steps, and surfaces the top three next-best suggestions with source attribution.

  • The agent updates work notes with the recommendations, analyzes case task patterns from similar closed cases, checks for existing tasks on the current case, and proposes a plan of up to five new tasks for the case handler to review and approve.

  • The Record Management Agent is available throughout the workflow to support fetch, update, create, and attachment operations on any task record as needed.

 

What Makes the Agentic Workflow Different

 

This workflow coordinates three distinct specialized agents under a single orchestration framework. Each agent has a clearly scoped responsibility, defined entry conditions, and explicit handoff logic. The orchestrator routes between them based on case state rather than requiring manual escalation or reassignment.

 

Triggers and State Routing

 

The workflow uses two entry points. The Triage Trigger fires on record creation when state = 1 (New). The Research Trigger fires on record update when state = 20 (Under Review), the case is active, the short description is not empty, and the assigned_to field is not the AI Agent placeholder user. This assigned_to check is intentional and prevents the Research Agent from firing on cases still being processed by the Triage Agent, which temporarily sets assigned_to to the placeholder user during its execution.

 

Complaint Case Triage Agent

 

The Triage Agent processes newly created complaint cases. Its core function is to determine category, subcategory, and priority from the case content and update the record automatically. It operates in two steps:

 

  • Classification: The agent fetches all category and subcategory choices from sys_choice for the sn_complaint_case table and filters them by the case's complaint_type (1 for product, 2 for location). It then analyzes the short description, description, and case details to select the correct category and subcategory, using a labelToIntMap to convert labels to integer values before updating the record. If the case content is empty, doesn't make sense, or does not match any recognizable patterns, the agent terminates and writes a work note stating it was unable to derive the fields. It will not guess or default to an arbitrary category.

  • Priority derivation: Priority is assigned as an integer (1 = Critical, 2 = High, 3 = Moderate, 4 = Low) based on factual business impact analysis of the case content. The agent explicitly does not rely on emotional language alone. It looks for indicators of regulatory violation, widespread impact, financial consequence, and operational disruption to distinguish between priority levels.

Note:

  • The Triage Agent will not prompt the case handler for input at any point. If derivation fails due to insufficient or ambiguous case content, the agent writes a work note and exits. Ensure complaint cases are created with sufficient description content for the agent to classify accurately.

  • After updating category, subcategory, and priority, the agent checks whether the assigned_to field is still set to the AI Agent placeholder user and clears it if so, returning the case to an unassigned state to be picked by a human agent/CSR.

 

Complaint Case Research Plan Agent

 

The Research Plan Agent activates only when a case is in Under Review state. It executes the following:

 

  • Previously attempted step extraction: The agent reads the case description and work notes and extracts specific actions already taken, and not general observations. These are stored and used later to filter duplicate recommendations.

  • Similar case and KB article search: Using only the case's short description as the search query (not work notes or comments), the agent searches for closed or resolved complaint cases and knowledge articles via the RAG Retriever. Close notes from similar cases and text from KB articles are extracted as candidates for troubleshooting steps.

  • Case task pattern analysis: The agent extracts case tasks from similar closed cases using the Get Case Task Details tool, groups semantically similar tasks, and identifies patterns in task type, frequency, and relevance.

  • Deduplication and filtering: The agent generates a combined list of all candidate steps from similar cases and KB articles, then subtracts the previously attempted steps using semantic similarity comparison. Steps that are worded differently but mean the same thing are also excluded.

  • Recommendation display and work notes update: The top three most relevant filtered steps are displayed as "Recommended next best suggestions" with source attribution (case number or KB article number). Additional suggestions are grouped by source below. All recommendations are written to the case's work notes.

  • Case task creation: The agent presents up to five recommended tasks as a structured plan of action, checks whether any overlap semantically with existing tasks on the current case, displays only the non-overlapping tasks to the case handler for approval, and creates them via the Create Case Tasks tool after confirmation.

Note:

  • The Create Case Tasks tool closes all existing open tasks on the complaint case before inserting new ones. The recommended plan replaces the prior task set rather than appending to it. If you need to preserve existing tasks, review the task list presented by the agent before confirming creation.

  • Source references in recommendations are always displayed as the original case number or KB article number. The agent is explicitly prohibited from fabricating case numbers, KB numbers, or troubleshooting steps. All content must come directly from the RAG Retriever search results.

 

Record Management AI Agent

 

The Record Management Agent handles general record operations across the workflow. It is a shared utility agent that supports fetching, updating, and creating task records; copying attachments between records; linking KB articles to task records; and retrieving related list data. It communicates with the assigned agent (not the caller) and never formats its output as an email. All responses are sent as informal text messages.

The agent uses a metadata-first approach for related record updates. It always fetches the parent record's metadata and related list structure before updating any related record, deriving the correct column name from the related list definition rather than assuming it from field names.

 

Details of registered tools by agent:

 

Complaint Case Triage Agent:

 

  • Category and Subcategory Choices: Fetches all category, subcategory, and complaint type choice values from sys_choice for sn_complaint_case, returning a structured map filtered by complaint_type and a labelToIntMap for integer conversion.

  • Update Fields: Updates category, subcategory, and priority fields on the complaint case record using integer values. Restricted to these three fields only—other field names are rejected. Also clears assigned_to if it is still set to the AI Agent placeholder user after the update.

  • Get Record Field and Meta Data: Retrieves field data and metadata for a given record number.

  • Update Worknotes: Writes a formatted summary of updated fields to the complaint case work notes, or writes a failure message if the agent was unable to derive classification fields.

 

Research Plan Agent tools:

 

  • Get Case Details Using Number and Fields: Retrieves specified output fields from a complaint case by number.

  • AIA RAG Retriever: Searches for similar closed complaint cases and knowledge articles based on the case short description.

  • Get Case Task Details: Returns task records (number, short description, description) for an array of complaint case sys_ids.

  • Update Worknotes: Writes recommended troubleshooting steps and sources to the complaint case work notes.

  • Create Case Tasks: Creates up to five case tasks in sn_customerservice_task linked to the complaint case. Closes all existing open tasks on the case before inserting new ones.

 

Record Management Agent tools:

 

  • Get Record Metadata, Update Record, Create Record, Update Related Record: Core record operation tools supporting the full CRUD surface for task records.

  • Get Fields from Table, Get Task Tables, Get Related Lists: Schema and metadata retrieval tools used to support dynamic field and table selection.

  • Copy Attachment to Record: Copies an existing attachment to a target record by sys_id. Runs in supervised execution mode.

  • Attach Knowledge Article to Task: Creates a link between a KB article and a task record in m2m_kb_task.

  • Get Attachment Details, Save Activity Notes: Retrieves attachment sys_ids for a record and saves resolution steps as structured activity notes.

 

Key Best Practices

 

  • Ensure complaint cases are created with a meaningful short description and description. The Triage Agent derives classification from case content. Sparse or vague descriptions will cause the agent to exit without updating fields and write a failure work note.

  • Keep category and subcategory choices in sys_choice up to date and scoped correctly to complaint_type. The Triage Agent filters choices by complaint_type before classification—missing or misconfigured dependent values will produce incorrect or absent classifications.

  • Index closed complaint cases with rich close notes in the RAG Retriever. The Research Agent's recommendation quality is directly proportional to the quality and volume of closed cases available for search. Cases closed without close notes will not contribute useful troubleshooting steps.

  • Do not modify the assigned_to guard condition on the Research Trigger without also updating the Triage Agent's logic that clears this field after execution. These two are coupled. The guard prevents premature Research Agent activation during Triage processing.

  • Review the case task plan presented by the Research Agent before confirming creation. The Create Case Tasks tool closes all existing open tasks before inserting new ones. If you have manually created tasks you want to preserve, decline the creation prompt and add the recommended tasks individually.

  • Monitor work notes on complaint cases after triage. If you see the message "The Complaint Case Triage Agent was unable to derive the category, subcategory, and/or priority," the case content was insufficient for classification. Review the case and update the description before manually classifying or reprocessing.

  • The Copy Attachment to Record tool runs in supervised mode and is the only tool in the workflow that requires explicit approval. All other tools across all three agents execute autonomously.

 

Formal Learning

For more learning on skills and agents in CSM, visit and enroll in our Now Assist for CSM Essentials course. 

 

Measured Success and Outcomes

 

Outcome

Value to Operations

Key Metric

Faster complaint triage

Eliminates manual effort to classify and prioritize newly created complaint cases

Time from case creation to category/priority assignment

Consistent case classification

Applies the same logic to every case, reducing classification variability across agents

% of complaint cases with category and priority populated at creation

Accelerated resolution research

Surfaces relevant troubleshooting steps from closed cases and KB articles without manual search

Time from Under Review to first recommended action

Structured resolution planning

Generates a coherent case task plan based on what worked in similar closed cases

% of complaint cases resolved using AI-recommended task plans

Reduced repeated troubleshooting

Filters already-attempted steps before surfacing recommendations, preventing redundant work

% of recommended steps accepted by case handlers

Full audit trail via work notes

Every agent action is documented in work notes, giving case handlers visibility into what was done automatically

% of complaint cases with agent-generated work notes at each stage

 

Frequently Asked Questions

 

  1. What triggers the Triage Agent? The Triage Agent fires automatically when a new complaint case record is created with state = New (1). No manual action is required.

  2. What triggers the Research Agent? The Research Agent fires when a complaint case is updated to state = Under Review (20), is active, has a non-empty short description, and is assigned to a human agent, not the AI Agent placeholder user.

  3. What happens if the Triage Agent cannot classify the case? If the case content is insufficient or does not match any recognizable category or subcategory patterns, the agent terminates without updating classification fields and writes a work note stating it was unable to derive the fields. The case handler must classify the case manually in this scenario.

  4. Will the Research Agent fabricate troubleshooting steps? No. The Research Agent is explicitly restricted to sourcing steps from the RAG Retriever search results. It will not generate steps from general knowledge or create fictional case numbers or KB article numbers. If no relevant results are found, it displays a message and exits.

  5. Does the Research Agent replace existing case tasks when creating new ones? Yes. The Create Case Tasks tool closes all existing open tasks on the complaint case before inserting the new recommended tasks. Review the proposed task plan carefully before confirming creation if you have manually created tasks you want to keep.

  6. Is any step in the workflow supervised (requires human approval)? Yes. Copy Attachment to Record runs in supervised execution mode and requires explicit approval before firing. All other tools across all three agents execute autonomously.

  7. How does the workflow prevent the Research Agent from firing during Triage processing? The Research Trigger includes a condition that blocks activation when assigned_to equals the AI Agent placeholder user. The Triage Agent temporarily sets this field during processing and clears it after updating the record, ensuring the Research Trigger cannot fire prematurely.

  8. Can I customize the number of recommended tasks? The Research Agent is currently hardcoded to recommend and create a maximum of five tasks. To change this, the agent instructions would need to be modified in the Now Assist AI Agent configuration for the Complaint Case Research Plan Agent.

Version history
Last update:
yesterday
Updated by: