Maximizing code reuse with topic blocks
Summarize
Summary of Maximizing Code Reuse with Topic Blocks
Topic blocks are reusable components in Virtual Agent conversations that streamline the authoring and maintenance of common tasks and conversational elements. They allow ServiceNow customers to create subflows that perform specific actions or tasks, enhancing efficiency through code reuse.
Show less
Key Features
- Creation and Management: Topic blocks are created using the Virtual Agent Designer, where users can set properties, define controls, test, and publish them for use in topics.
- Nesting Capability: Topic blocks can call other topic blocks, allowing for nested structures, but cannot call themselves, preventing infinite loops.
- Pre-built Topic Blocks: The platform offers pre-built topic blocks for tasks like transferring conversations to live agents, conducting surveys, gathering geolocation data, and more, which can be duplicated and customized as needed.
- Updated User Interface: An updated Assistant Designer Asset library user interface is available for users with the Now Assist Topics skill activated, enhancing the management of topic blocks.
Key Outcomes
By implementing topic blocks, ServiceNow customers can:
- Reduce redundancy by reusing common functions across multiple conversation topics.
- Enhance the flow of conversations by integrating useful pre-built components.
- Maintain and update their topic blocks easily, with notifications for necessary changes in calling topics.
Overall, topic blocks empower customers to create efficient, organized, and reusable conversational elements within Virtual Agent, ultimately improving user interaction and operational efficiency.
Topic blocks are reusable components that you can create to run common tasks and conversational elements in Virtual Agent conversations. Topic blocks simplify the topic authoring and maintenance process by enabling you to reuse standard procedures or actions across conversation topics.
How reusable topic blocks work
- Set topic block properties.
- Define the controls (nodes) used in the block.
- Test or preview the block.
- Publish the block to make it available for use in topics or other topic blocks.
Unlike topics, topic blocks are not discoverable by a large language model (LLM), Natural Language Understanding (NLU), or keywords. The topic block's functionality can only be accessed by a topic.
A conversation that uses (consumes) a topic block is referred to as the calling topic. A topic block can call another topic block, but it cannot call itself. You can "nest" topic blocks in this manner, even if the flow returns to the initial topic, as in this example:
The Virtual Agent platform and applications provide pre-built topic blocks for common tasks or subflows. You can use these pre-built topic blocks in your conversation topics "as is" in the appropriate application scope by duplicating them. You can then customize these pre-built topic blocks as needed. Some of the common topic blocks include the following.
| Pre-built topic blocks | Application scope |
|---|---|
|
Global. Provided with the Glide Virtual Agent plugin (com.glide.cs.chatbot). |
| Contextual search: Uses a search phrase to return search results in a card format, such as knowledge articles and catalog items. | Common topic block used by the CSM, HR Service Delivery, and ITSM business applications. Provided with the Service Management Virtual Agent Topic Blocks plugin (com.glideapp.cs.sm_topic_blocks). This plugin is included with the Virtual Agent conversation plugins for these business applications. |
On the home page, you can use the filter icon to filter and view only the topic blocks.
After you create and publish a topic block, the block is available for use as a Topic Block utility in Virtual Agent Designer. You can add the topic block to a calling topic or to another topic block. In the following example, the calling topic uses the Contextual Search topic block. When a topic calls the Contextual Search topic block, the conversation flow contained in the topic block executes.
What to do next
- Create a reusable topic
block.
Build a conversation component that performs a common function that can be reused in Virtual Agent conversations.
- Add a reusable topic block to a
calling topic or topic block.
To run a specific subflow, add a reusable topic block to a calling (parent) topic or topic block. Specify the inputs that are used in the topic block and review outputs that are returned from the topic block.
- Maintain topic blocks and associated calling
topics (as needed).
When you update a published topic block, Virtual Agent Designer performs certain checks. Displayed messages inform you of changes that you may want to make to calling topics that use the updated block.