What It Is

Virtual Agent is ServiceNow's conversational AI platform that transforms traditional form-based interactions into natural language conversations. It sits as a middleware layer between users and ServiceNow's core platform functionality, intercepting requests that would traditionally require navigating forms, catalogs, or knowledge bases. The system processes user intents through machine learning models, maps those intents to specific ServiceNow actions, and executes those actions while maintaining conversational context throughout multi-turn interactions.

Architecturally, Virtual Agent lives within the Customer Service Management application but extends across the entire platform through the Conversation Designer framework. The core engine operates at the application layer, with conversation definitions stored in the sys_cs_conversation and sys_cs_topic tables, while the runtime execution happens through the NLU (Natural Language Understanding) service that processes against training models stored in the ml_capability framework. Integration points extend into every major ServiceNow application through Flow Designer actions, catalog items, knowledge articles, and direct table operations.

The underlying data model centers on conversations, topics, and intents as the primary configuration objects. Conversations define the overall user experience and available topics, while topics contain the specific interaction logic including NLU training phrases, slot filling for data collection, and action execution through Flow Designer integrations. The system maintains conversation state through the sys_cs_context table, allowing for complex multi-step processes that remember previous user inputs and context across conversation turns. Virtual Agent executes within ServiceNow's standard security model, respecting ACLs, roles, and data visibility rules for the conversation user's session.

You cannot function without Virtual Agent when your organization requires 24/7 automated support for routine ServiceNow operations, particularly in environments with high-volume, repetitive requests that overwhelm traditional service desk capacity. It becomes essential for organizations implementing self-service strategies where user adoption depends on conversational interfaces rather than complex catalog navigation. Virtual Agent is critical for enterprises that need to provide ServiceNow functionality to users who lack platform familiarity, such as external customers, contractors, or employees who interact with ServiceNow infrequently but need immediate access to specific services like password resets, access requests, or incident status updates.

Virtual Agent management typically involves a collaboration between ServiceNow administrators, developers, and business analysts. Administrators handle the initial setup, user provisioning, and integration configuration, while developers create custom Flow Designer actions and complex conversation logic. Business analysts often own the conversation design, intent mapping, and training phrase optimization based on actual user interaction patterns. The platform owner typically governs the overall Virtual Agent strategy, including which processes get automated, performance thresholds, and escalation patterns to human agents. In practice, successful Virtual Agent implementations require ongoing collaboration between these roles, as conversation optimization depends on both technical configuration and business process understanding.

Recent ServiceNow releases have significantly evolved Virtual Agent capabilities, particularly around the Conversation Designer interface and NLU engine improvements. Vancouver introduced enhanced Flow Designer integration patterns and improved conversation analytics, while Xanadu brought more sophisticated context management and better support for complex, multi-step business processes. The Washington release added significant improvements to the conversation testing framework and introduced better debugging capabilities for conversation flow issues. Most importantly, recent versions have improved the conversation handoff mechanism to human agents, allowing for seamless escalation while preserving conversation context and collected user data.

Where to Find and Configure It

Primary Virtual Agent configuration happens through Virtual Agent > Designer, where you build and manage conversations, topics, and their associated flows. The Conversation Designer interface provides the visual workflow builder for creating conversation logic, managing NLU training data, and configuring topic-specific actions. Navigate to Virtual Agent > Conversations to manage conversation definitions, enable/disable conversations, and configure conversation-level settings like fallback behavior and escalation rules.

Secondary configuration locations include Virtual Agent > Analytics for monitoring conversation performance and user interaction patterns, and Virtual Agent > NLU Workbench for testing and refining natural language understanding capabilities. Access System Definition > Tables to directly examine conversation data in tables like sys_cs_conversation, sys_cs_topic, and sys_cs_context for troubleshooting conversation behavior or performing bulk configuration changes.

Virtual Agent operates in action through the Service Portal via the Virtual Agent Chat widget, which can be embedded in any Service Portal page or launched as a standalone chat interface. Monitor active conversations through Virtual Agent > Live Chat Sessions to observe real-time user interactions and troubleshoot conversation flow issues. Flow Designer integration happens through Process Automation > Flow Designer, where you build the actual business logic that Virtual Agent topics trigger during conversations. Virtual Agent operates identically in both scoped and global applications, though conversation topics can reference flows and actions only within their application scope unless explicitly made global.

How It Works Step by Step

Virtual Agent processes user interactions through a sophisticated natural language understanding pipeline that begins when a user submits text input through the chat interface. The system first preprocesses the input text, normalizing language variations and extracting potential entities, then passes the processed input to the NLU service which compares it against trained models for all available topics within the active conversation. The NLU engine returns confidence scores for potential intent matches, and Virtual Agent selects the highest-confidence match above the configured threshold to determine which topic should handle the user's request.

Once a topic is selected, Virtual Agent executes the topic's conversation flow, which typically involves collecting required information through slot filling, validating collected data against business rules, and executing the associated Flow Designer action or direct ServiceNow operation. The system maintains conversation state throughout this process, storing user inputs, flow variables, and context information in the conversation session data. If the topic requires additional information from the user, Virtual Agent generates appropriate prompts and waits for user responses, maintaining the conversation context until all required data is collected and the business process can be completed.

The execution environment integrates directly with ServiceNow's security model, executing all operations within the context of the conversation user's session and respecting their role-based access controls. When topics trigger Flow Designer actions, those flows execute with the same user context and security constraints, ensuring that Virtual Agent cannot perform operations the user wouldn't be authorized to complete through traditional ServiceNow interfaces. The system also handles error conditions and fallback scenarios, escalating to human agents or alternative topics when confidence thresholds aren't met or when business logic execution fails.

Free Newsletter

Enjoying this? Get one deep-dive per week.

Join 1,000+ ServiceNow pros — scripts, GlideRecord patterns, Flow Designer techniques, and career moves. Free.

No spam · Unsubscribe anytime

The Execution Order

  1. User submits text input through the Virtual Agent chat interface
  2. Input preprocessing normalizes text and extracts potential entities
  3. NLU service evaluates input against all trained topic models in the active conversation
  4. System selects highest-confidence topic match above configured threshold
  5. Selected topic's conversation flow begins execution
  6. Slot filling process collects required information through conversational prompts
  7. Data validation occurs against configured business rules and constraints
  8. Associated Flow Designer action executes with user security context
  9. Results are formatted and returned to user through conversational response
  10. Conversation context and analytics data are stored for future reference
topic_action_script.js
// Virtual Agent topic action script example
// This runs within a Flow Designer action called by a VA topic

(function execute(inputs, outputs) {
    var incidentGR = new GlideRecord('incident');
    
    // Get user input from Virtual Agent conversation
    var shortDescription = inputs.short_description;
    var userSysId = inputs.user_sys_id;
    var urgency = inputs.urgency || '3';
    
    // Create new incident with Virtual Agent context
    incidentGR.initialize();
    incidentGR.setValue('caller_id', userSysId);
    incidentGR.setValue('short_description', shortDescription);
    incidentGR.setValue('urgency', urgency);
    incidentGR.setValue('opened_by', userSysId);
    incidentGR.setValue('contact_type', 'virtual_agent');
    
    var incidentSysId = incidentGR.insert();
    
    // Return data to Virtual Agent for user response
    outputs.incident_number = incidentGR.getDisplayValue('number');
    outputs.incident_sys_id = incidentSysId;
    outputs.success = true;
})(inputs, outputs);

Real-World Scenarios

Automated Incident Creation with Smart Categorization

Users need to report incidents through conversational interface while ensuring proper categorization and routing without requiring knowledge of ServiceNow's incident classification structure. The Virtual Agent must collect incident details, automatically suggest categories based on description keywords, and route to appropriate assignment groups based on the final categorization.

Create a conversation with a Report Incident topic that includes training phrases like 'I need to report a problem', 'Something is broken', and 'Create incident'. Configure slot filling for short_description, urgency, and detailed_description slots. Build a Flow Designer action that uses the description text to query a category mapping table, automatically populates category and subcategory based on keyword matching, and sets the assignment group according to category-based business rules. Include conversation responses that confirm the incident number and expected resolution timeframe.

⚠️

Users will often provide incomplete or ambiguous descriptions initially. Configure your topic with follow-up prompts that ask clarifying questions when the category detection confidence is below 70%, and always allow users to override suggested categories through conversational confirmation.

Multi-Step Access Request with Approval Workflow

Employees require a conversational interface to request access to applications and resources while maintaining proper approval workflows and compliance documentation. The system must collect request details, validate against user's current access, route through appropriate approval chains, and provide status updates throughout the process.

Design a Request Access topic with slots for application_name, access_type, business_justification, and required_date. Create a Flow Designer subflow that validates the request against the user's current roles, creates a request item in the Service Catalog, and triggers the appropriate approval workflow based on application risk level. Configure a separate topic for Check Access Request Status that queries active requests and provides conversational status updates including approval stage, estimated completion time, and next steps required from the user.

💡

Implement conversation memory by storing the request item sys_id in the Virtual Agent context. This allows users to reference 'my recent access request' in follow-up conversations without requiring them to provide request numbers, significantly improving the user experience for status inquiries.

Knowledge Article Search with Contextual Follow-up

Users need to find relevant knowledge articles through natural language queries while providing feedback on article usefulness and seamless escalation to human support when articles don't resolve their issues. The Virtual Agent must search knowledge base content, present results conversationally, and capture user satisfaction data for knowledge management improvement.

Build a Find Help topic that captures user queries and executes a Flow Designer action performing knowledge base searches using the ServiceNow Search API with enhanced relevance scoring. Configure the conversation flow to present the top 3 article summaries with options for users to request full articles, search for additional results, or indicate that results weren't helpful. Create follow-up conversation logic that captures user feedback through simple yes/no questions about article helpfulness, automatically updates knowledge article analytics, and offers escalation to live chat or incident creation when users indicate the articles didn't solve their problem.

ℹ️

Knowledge search performance in Virtual Agent depends heavily on your knowledge base article quality and search configuration. Ensure articles have proper short descriptions, tags, and categories configured, and consider implementing search result caching for frequently requested topics to improve response times.

The Classic Mistake

⚠️

Creating topic conditions that check sys_user fields without handling unauthenticated users, causing "user is null" errors and conversation failures.

Topic Condition - BAD
// Topic condition script - WRONG approach
// This will fail for unauthenticated users
if (current.u_department == 'IT' && 
    conversation.user.department.name == 'Information Technology') {
    return true;
}

// Another common failure pattern
if (conversation.user.roles.contains('itil')) {
    // Set IT-specific variables
    conversation.setVariable('show_advanced_options', 'true');
    return true;
}

// This also breaks for anonymous users
var userRecord = new GlideRecord('sys_user');
userRecord.get(conversation.user.sys_id);
if (userRecord.u_security_clearance == 'high') {
    return true;
}

This fails because Virtual Agent conversations can be initiated by unauthenticated users, making conversation.user null or undefined. The user sees a generic "Something went wrong" message while the system logs show JavaScript errors about accessing properties of null objects. ServiceNow's Conversation Designer doesn't validate these conditions at design time, so the error only surfaces when real users trigger the problematic topic. The mistake is non-obvious because testing often happens with authenticated admin accounts that have valid user records.

Topic Condition - CORRECT
// Always check if user exists and is authenticated first
if (!conversation.user || !conversation.user.sys_id) {
    // Handle anonymous users - maybe show general topic
    return input.text.toLowerCase().includes('general help');
}

// Now safely access user properties
var user = conversation.user;
if (user.department && user.department.name == 'Information Technology') {
    // Additional role check with null safety
    if (user.roles && user.roles.contains('itil')) {
        conversation.setVariable('show_advanced_options', 'true');
        return true;
    }
}

// Alternative: Use try-catch for complex user queries
try {
    var userGR = new GlideRecord('sys_user');
    if (userGR.get(user.sys_id)) {
        return userGR.u_security_clearance == 'high';
    }
} catch (e) {
    gs.warn('VA topic condition error: ' + e.message);
    return false;
}
💡

Always null-check conversation.user and conversation.user.sys_id before accessing any user properties in topic conditions, utterance matching, or action scripts.

When to Use This vs Alternatives

Virtual Agent is the right choice when you need guided, conversational self-service that reduces agent workload for routine requests like password resets, status checks, and simple approvals. It excels at replacing repetitive phone calls and emails with structured interactions that can authenticate users, gather required information step-by-step, and create properly formatted records.

When Virtual Agent is the Correct Choice

Choose Virtual Agent over Service Portal or direct form submission when users need guidance through complex request processes or when you want to reduce incomplete submissions. It handles authentication, conditional logic, and validation better than static forms while providing immediate feedback that email-based processes cannot match. Virtual Agent also works where mobile apps fall short – it requires no installation and works across all devices through the existing portal infrastructure.

When to Use Something Else Instead

Skip Virtual Agent for complex forms with extensive conditional logic, file attachments, or rich text editing – Service Portal catalog items handle these scenarios more effectively. Use Flow Designer instead when you need sophisticated approval chains, external system integrations, or complex business logic that doesn't require user interaction. For high-volume, simple lookups like password policy information or office hours, static Knowledge Base articles with good search optimization will perform better and require less maintenance.

When You Need Both Virtual Agent and Alternatives

Combine Virtual Agent with Flow Designer when the chatbot needs to trigger complex backend processes – VA handles user interaction and data collection, while Flow manages approvals, notifications, and system integrations. Integrate with Service Portal when users need to switch between conversational and traditional form interfaces within the same request process. Use Virtual Agent alongside Knowledge Management by having the bot surface relevant articles during conversations and fall back to knowledge search when it cannot handle specific user intents.

Platform Interactions & Side Effects

  • Business Rules fire normally when Virtual Agent creates records, but gs.getUserID() returns the Virtual Agent system user ID, not the actual conversation user, breaking audit trails and assignment logic
  • ACL evaluation uses the Virtual Agent service account permissions by default, potentially allowing record access that the actual user shouldn't have through sys_user_has_role table checks
  • Conversation logs write to csm_consumer_interaction table with full message history, creating potential data privacy concerns for sensitive information collected during chats
  • Update Sets capture Virtual Agent configurations across multiple tables (sys_cs_topic, sys_cs_action, sys_cs_topic_utterance) but don't migrate conversation history or analytics data
  • Email notifications triggered by VA-created records use the system user as sender unless explicitly overridden with gs.getUser() context switching in notification scripts
  • Session state persists across conversation steps in sys_cs_conversation table, but variable values are lost if users refresh browser or switch devices mid-conversation
  • Performance degrades significantly with complex topic conditions or large utterance datasets, as NLU processing happens synchronously during user interactions
  • Client Scripts on forms don't execute when Virtual Agent populates fields, potentially bypassing field validation and dependent field logic configured for manual entry
  • Knowledge Base integration queries the kb_knowledge table with elevated permissions, potentially surfacing articles that users couldn't normally access through portal search
  • Multi-language configurations create separate topic instances in sys_cs_topic for each language, multiplying maintenance overhead and breaking shared action scripts that reference specific topic sys_ids

Debugging and Troubleshooting

The most common failure symptoms include conversations that start but immediately show "I don't understand" responses, topics that trigger but execute the wrong actions, and users seeing generic error messages instead of expected prompts. Admins typically notice these issues through increased help desk calls about "the chatbot not working" or analytics showing high abandonment rates on specific conversation paths. The challenge is that Virtual Agent errors often fail silently from the user perspective while generating obscure error messages in system logs.

Start troubleshooting in System Log > All filtered by source com.snc.cs for Virtual Agent-specific errors, and check csm_consumer_interaction table for conversation flow details including variable states and topic transitions. Enable debug logging by setting com.snc.cs.conversation.debug system property to true, which provides detailed information about NLU processing, topic matching, and action execution in the logs.

Look for specific error patterns like "TypeError: Cannot read property 'sys_id' of null" indicating user context issues, "Topic condition evaluation failed" showing script syntax problems, or "NLU confidence below threshold" suggesting utterance training data problems. The Virtual Agent > Designer > Test interface provides real-time debugging with confidence scores and topic matching details, but remember it runs with admin privileges and may not reflect actual user experience. Check the sys_cs_debug_log table for detailed conversation flow analysis when debug mode is enabled.

Diagnostic Checklist:

  • Verify topic is published and active in Virtual Agent > Designer - unpublished changes don't affect live conversations
  • Test topic conditions with anonymous user context - log in as different user roles or test incognito to simulate real user permissions
  • Check utterance confidence scores in test interface - scores below 0.6 typically need additional training phrases
  • Validate action scripts syntax and null-check all user and conversation variables before accessing properties
  • Review conversation analytics in Virtual Agent > Analytics for drop-off patterns and unhandled user inputs
  • Confirm Virtual Agent service account has required permissions for tables and fields accessed in topic actions
  • Clear browser cache and test in different browsers - JavaScript errors in portal can break conversation interface silently

Quick Reference

  • Conversations timeout after 30 minutes of inactivity by default, controlled by com.snc.cs.conversation.timeout.minutes system property
  • Maximum of 50 topics per Virtual Agent application, with utterance training limited to 1000 phrases per topic for optimal NLU performance
  • Topic conditions execute before utterance matching, so failed conditions prevent NLU processing entirely regardless of perfect phrase matches
  • Variable names in conversation context are case-sensitive and persist across topic transitions within the same conversation session
  • Action scripts run in global scope without access to current form context, breaking typical g_form client-side patterns
  • NLU confidence threshold of 0.4 triggers topic matching, but scores below 0.6 often produce unreliable results in production
  • Publishing topic changes can take up to 5 minutes to appear in live conversations due to NLU model retraining and cache refresh
  • Conversation history in csm_consumer_interaction includes full message content and is subject to data retention policies, not automatic cleanup
  • System properties starting with com.snc.cs control Virtual Agent behavior but changes require instance restart or service restart to take effect
  • Integration with Microsoft Teams or Slack requires separate licensing and creates additional conversation contexts that don't share variable state with portal sessions