Debug a Virtual Agent topic
Summarize
Summary of Debug a Virtual Agent topic
This guide helps ServiceNow customers investigate and resolve issues in custom Virtual Agent topics, topic blocks, and controls. It emphasizes best practices for debugging, testing, and resolving common errors to ensure smooth Virtual Agent conversations.
Show less
Best Practices for Debugging
- Duplicate before editing: Always duplicate a live topic before making changes. This preserves the original as a backup and reference, allowing quick restoration if needed. Deactivate the original topic before publishing the duplicate.
- Test during development: Use the Test button in Virtual Agent Designer to preview conversations. The test chat window mimics Service Portal behavior but test in third-party messaging apps as well to confirm consistent user experience.
Debugging Tools in Test Chat Window
The test chat window provides four tabs for detailed debugging:
- Analyze test phrases
- Variables
- Context
- Logs
These tabs help you review processing messages, errors, and conversation variables to refine your topic logic.
Identifying Issues in Topics
- Control warnings: Controls missing required information show a red badge with issue count. Clicking the badge lists specific problems for correction.
- Topic-level warnings: A warning badge indicates the total number of issues in the entire topic.
- Preview errors: If a topic preview fails, detailed errors appear under the designer canvas with links to the problematic nodes for quick navigation and fixing.
- Validation Issues on Publish: Publishing prompts a Validation Issues tab if errors remain, which disappears once all issues are resolved.
Common Issues and Resolutions
- Missing module designer: Ensure the user has the
virtualagentadminrole and the Virtual Agent plugin is activated. - Cannot edit topic: User must be in the same application scope as the topic.
- Cannot preview topic: Verify all required node fields are completed and browser pop-ups are enabled for the instance.
- Chat widget stuck on connecting: Check that topics exist and are active on the instance.
Reviewing Conversation Flows
Each Virtual Agent conversation generates an interaction record logged in the Interactions [interactions] table. This record captures the full transcript, including any live agent transfers, helping you analyze real user interactions.
Resolving NLU Topic Discovery Issues
If intents are not selected as expected, troubleshoot Natural Language Understanding (NLU) prediction errors. Understanding how Virtual Agent returns and selects intents is key to improving topic discovery and user intent matching.
Investigate and resolve unexpected behavior in your custom Virtual Agent topics, topic blocks, and controls.
For information about topic discovery issues, see LLM topic discovery in Virtual Agent and Resolve Natural Language Understanding (NLU) topic discovery issues.
Duplicate a live topic before debugging and changing it
Duplicate a topic rather than update a live topic. The unmodified original topic can serve as both a reference and a backup, and retaining the original enables you to restore the topic quickly. Remember to deactivate the original topic before publishing the duplicate.
Debug a topic while testing your conversations
As you create or update a topic in Virtual Agent Designer, use the Test button in the topic header bar to preview the conversation. The chat test window shows the conversation as it appears within Service Portal. Elements in your conversation might appear differently in third-party messaging applications. Test your conversations in any third-party applications where you intend to deploy Virtual Agent.
The test chat window displays four tabs that provide detailed information for debugging and refining your topic: Analyze test phrases, Variables, Context, and Logs. For details on these tabs, see Testing NLU/Keyword topics. The following example shows the processing messages and errors logged during testing.
Watch for warnings on controls within your topic
Controls that are missing necessary information show a red incomplete badge in the upper left corner of the control. The badge shows a number indicating the number of issues in that control. Select this badge to see a list of the issues in the control.
Another warning badge appears in the upper left corner of the designer to indicate the number of issues within the entire topic.
Check for errors when a topic preview does not run
Additional information appears under the Virtual Agent Designer canvas when an error prevents the topic from running. The total number of Issues are listed, along with details and a hyperlink for each. Select a hyperlink to go to the node, and use the information provided to correct any errors in your conversation. You can close the tab without correcting the issues, but until the issues are corrected, the Validation Issues tab appears when you select Publish. The Validation Issues tab closes if you select Publish after correcting all issues.
Common Virtual Agent issues
| Issue | Possible resolution |
|---|---|
| Cannot see module designer under conversational interfaces |
|
| Cannot edit a topic | Logged-in user must be in the same application scope as the topic. |
| Cannot preview topic |
|
| chat widget stuck at Connecting... | One or more of your topics might be missing. Check the Topics page to ensure that topics are present on the instance and in the Active state. |
Review topics that run in a conversation flow
Each Virtual Agent (VA) conversation in an instance automatically generates an interaction record in the Interactions [interactions] table, which logs the conversation between a requester and virtual and live agent. You can review the transcript of the conversation between the requester and virtual agent, including live agent transfers (if using Agent Chat). For details, see Virtual Agent interaction records.