Roles, tables, and scheduled jobs included with Query Generation
Summarize
Summary of Roles, tables, and scheduled jobs included with Query Generation
The Query Generation feature in ServiceNow Yokohama release installs several components including roles, tables, and scheduled jobs that enable semantic query capabilities. These components work together to support natural language queries by defining entities, dimensions, and segments that enhance how data is interpreted and retrieved.
Show less
Roles
- snquerygen.user: Grants access to call the Query Generation service from applications. This role should be included in the user roles of applications that use Query Generation.
- snquerygen.admin: Provides administrative access to Query Generation tables. Users with this role can configure table settings, modify entity and dimension records, and manage segments in the utterance bank.
- Additional roles such as snnowassistadmin.nsa.admin and aisadmin also include the snquerygen.user role.
Scheduled Jobs
- [Query Generation] Sync Segments Job: Runs weekly by default to generate and synchronize segments from reports, indicator sources, and filters. It also cleans up unused segments and related entity/source records.
- [Query Generation] Generate Semantic Layer: Runs on demand to regenerate segments if entities or dimensions are missing. Typically used only when manual intervention is needed.
- [Query Generation] Semantic Entity Auto-Scaling Job: Runs daily to synchronize entity activation states and assist with semantic entity scaling.
Tables
All Query Generation tables require admin role access and are available under the Query Generation module.
- Entity [snquerygenentity]: Represents tables enabled for semantic generation. Records are auto-generated and read-only.
- Dimension [snquerygendimension]: Represents queryable columns for each entity table. Records are auto-generated and read-only.
- Segments [snquerygensegment]: Defines reusable context segments that help the semantic layer interpret queries correctly. Admins can create, edit, or delete segments here.
- Manual Segment Configs [snquerygensegmenttableconfig]: Stores manually created segments that synchronize with the Segments table via the Sync Segments job.
- Utterance Bank [snquerygenutterancebank]: Contains predefined sentences mapped to database contexts to assist query matching. Admins can manage these entries.
- AI Search Search Profile [aissearchprofile]: Configures search experiences linked to search boxes within applications. Admins can create and manage profiles.
- AI Search Indexed Sources [aisdatasource]: Lists searchable content sources, including instance and external tables. Editing requires snquerygen.admin or higher.
- Logs [snquerygenlog]: Records all calls to Query Generation for auditing and troubleshooting purposes.
- Semantic Table Configuration [snquerygentableconfig]: Lists tables available for semantic search with configuration options such as enabling semantic generation and including child tables. Admins manage this table.
Practical Benefits for ServiceNow Customers
By leveraging these roles, scheduled jobs, and tables, customers can:
- Enable natural language query capabilities within their ServiceNow applications.
- Customize and extend semantic data models by managing entities, dimensions, and segments.
- Maintain data accuracy and relevance through automated synchronization and cleanup jobs.
- Control and tailor search experiences via search profiles and utterance banks.
- Monitor and troubleshoot Query Generation usage through detailed logs.
Several types of components are installed with Query Generation, including tables and scheduled jobs.
Roles included
| Role name | Description | Contains roles |
|---|---|---|
|
sn_query_gen.user |
Allows the person with the role to call the Query Generation service through the app they are using. |
None, but applications that call Query Generation should contain this role in their own user roles. |
|
sn_query_gen.admin |
Allows the user to access the Query Generation tables like an admin user. Can configure sn_query_gen_table_config records and modify Entity and Dimension records as well as set up segments in the utterance bank. |
|
Scheduled jobs installed
| Scheduled job | Description |
|---|---|
| [Query Generation] Sync Segments Job | Generates segments from report sources, reports, indicator sources, modules, and filters. Synchronizes manual segments with segment table. Cleans up unused segments and Entity and Source records. Cleans up segments based on unused or otherwise ineligible reports, report sources, and indicator sources. Runs when Query Generation is first installed and then weekly by default. |
|
[Query Generation] Generate Semantic Layer |
Generates segments from report sources, reports, indicator sources, modules, and filters. Synchronizes manual segments with segment table. Cleans up unused segments and Entity and Source records. Runs on demand. Intended for use only when you believe some entities or dimensions are missing. Otherwise, rely on the scheduled [Query Generation] Sync Segments Job. |
|
[Query Generation] Semantic Entity Auto-Scaling Job |
Synchronizes entity activation states and helps with semantic entity scaling. Runs daily by default. |
Tables installed
All tables require the admin role for access and are available under Query Generation in the Navigator.
| Table | Description |
|---|---|
|
Entity [sn_query_gen_entity] |
Representations of the tables that have semantic generation enabled for them (explicitly or through their parent tables) on the Semantic Table Configuration [sn_query_gen_table_config] table. Each Entity record corresponds to one supported table. Entity records are generated automatically, and this table is read-only. |
|
Dimension [sn_query_gen_dimension] |
Representation of queryable columns for every table that an Entity record references. Each record corresponds to one column. Dimension records are generated automatically, and this table is read-only. |
| Segments [sn_query_gen_segment] |
Reusable definitions that provide non-obvious context, to assist the semantic layer or LLM to select the correct entity, dimension, and values. For example, in the utterance "How many open emergency change requests are there?", a segment identifies that "open" means "active=true" and "emergency" is a Type, not a Priority. Admins can add new segments, delete existing segments, or edit segment names and descriptions. |
| Manual Segment Configs [sn_query_gen_segment_table_config] |
Manually created segments. The [Query Generation] Sync Segments job syncs this table up to the Segments table. |
| Utterance bank [sn_query_gen_utterance_bank] |
Predefined sentences and phrases mapped to database contexts and queries. User questions are compared to the utterance bank to see if a predefined mapping can apply. Admins can create, edit, and delete utterance banks. |
| AI Search Search Profile [ais_search_profile] |
A container for all search experience configurations. A search profile is mapped to a specific experience you would like to expose in your app. Search Profile is linked to a search box and can be used across applications. Admins can create, clone, and publish search profiles. |
| AI Search Indexed Sources [ais_datasource] |
Records on this table reflect what content users can search on. The content can be tables on the instance or external tables. You have the necessary indexed sources by default. The sn_query_gen.admin role or higher is necessary to edit this table. The most likely use case is if the system cannot find the correct table and not all the indexed queries are fully applied. For more information, see Common AI Data Explorer issues and fixes. |
| Logs [sn_query_gen_log] |
A log of every call to Query Generation. For more information, see Query Generation logs. |
| Semantic table configuration [sn_query_gen_table_config] |
List of tables that Query Generation can search, whether semantic generation is enabled for that table, and whether child tables are included. Admins can create, edit, and delete these records. For more information, see Add a table to the semantic data layer. |