> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent AI Chat Integration with ServiceNow

This document provides detailed instructions on integrating the Agent AI widget with ServiceNow Desktop for the Chat channel. The integration supports [all Agent AI features](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3), including end-of-call summary and Custom Data passing (for example, agent name and ID) to the Agent AI widget.

## Supported ServiceNow Workspaces

* HR Agent Workspace: Supported (validated)
* IT/Service Operations Workspace: Supported (validated)
* Other workspaces (CSM, custom): Supported, if they follow the HR-workspace pattern

## Key Architectural Clarification

Agent AI is a reusable UI component that you can embed in any workspace.

* You must add the Agent AI component to each workspace individually.
* Adding Agent AI to one workspace doesn't make it available in other workspaces within the same instance.
* Agent AI isn't automatically propagated across workspaces.

### Adding Agent AI to a Specific Workspace

1. Sign in to the **ServiceNow** instance.
2. Search in the **All** > **Filter** navigator.
3. Go to **UI Builder** > **Experiences** > **Workspace Experience** > **UI Builder**.
4. Select the target workspace-**HR**/**IT**/**Custom**.
5. Add the **Agent AI by kore.ai** component to the **Record Page**.
6. Bind it to the agent panel or desired region. Refer to the [Data Binding(sysId)](#additional-configuration-for-hr-agent-workspace-optional) section for help.
7. Publish the workspace.

   <Note>There is no configuration flag to associate Agent AI with a workspace. You determine the workspace by embedding the component there.</Note>

## Prerequisites

This section outlines the essential components, credentials, and permissions required for integrating Agent AI Chat with ServiceNow.

* Required Components:
  * ServiceNow Instance
    * Xanadu, Yokohama, or Zurich release
    * Configured to receive desktop chats
  * Agent AI Account
    * Enabled Web/Mobile channel
    * Required AI Agent credentials: Bot ID, Client ID, Client Secret, and Widget URL (Credential Location: Go to **Agent AI** > **Flows and Channels** > **Channels** > **Digital** > **Web/Mobile Client** > **JWT App Details**.)
* Roles and Permissions:
  * ServiceNow: Admin Role
  * Platform (Optional): Required only if you are doing an Agent Transfer from Platform to ServiceNow. For more information, refer to [Configuring the ServiceNow Agent - Utah and Higher versions](/ai-for-service/integrations/agents/servicenow/configuring-the-servicenow-agent-utah-and-vancouver).

## Interaction between ServiceNow and Agent AI

The following architecture diagram shows the interaction between ServiceNow and Agent AI:

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/snow-kore.ai-architecture.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=5f7a2d2772f8b827fb1752c6e364b38c" alt="snow-kore.ai-architecture" width="1257" height="1220" data-path="ai-for-service/agentai/integration/servicenow/images/snow-kore.ai-architecture.png" />

## Set Up Agent AI in ServiceNow Sandbox

Setting up Agent AI chat with ServiceNow includes the following steps:

* Set Up Agent AI in ServiceNow Sandbox
  * [Download from the ServiceNow Store (recommended)](#step-1-download-from-the-servicenow-store-recommended),
    or
  * [Install Using an Update Set](#install-using-an-update-set)
* [Set Up Agent AI App Configuration](#step-2-set-up-agent-ai-application-configuration)
* [Test the Configuration](#step-3-test-the-integration)
* [XO Configuration (Optional)](#step-4-xo-configuration-optional)
* [Using the Agent AI widget](#step-5-using-the-agent-ai-widget)

### Step 1: Download from the ServiceNow Store (recommended)

1. Get the [Agent AI by Kore.ai](https://store.servicenow.com/sn_appstore_store.do#!/store/application/92d544cec3da0a9082881b6ce0013194/1.0.0?referer=%2Fstore%2Fsearch%3Flistingtype%3Dallintegrations%25253Bancillary_app%25253Bcertified_apps%25253Bcontent%25253Bindustry_solution%25253Boem%25253Butility%25253Btemplate%25253Bgenerative_ai%25253Bsnow_solution%26q%3Dkore\&sl=sh) application from the ServiceNow store.
2. Click **GET** to begin the application entitlement process.
3. Select the organization name where you want to install this application.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/servicenow-org-selection.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=c66d44c6caaeae5d41efe972a91bdf39" alt="org-name-selection" width="2940" height="1668" data-path="ai-for-service/agentai/integration/servicenow/images/servicenow-org-selection.png" />

**or**

### Install Using an Update Set

1. Ask the Support team for the relevant Update Set XML file.

2. Search in **All** > **filter** navigator as **Retrieved Update Sets**, which is under **System Update Sets**, and open it.

3. Under **Related Links**, click **Import Update Set from XML**.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/import-update-xml.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=d94b198775b8e0d2824b30a0c5750190" alt="import-update-xml" width="1841" height="209" data-path="ai-for-service/agentai/integration/servicenow/images/import-update-xml.png" />

4. Open the update set **Agent AI by kore.ai** (official update set name).

#### Preview Update Set

To preview the update set, click the **Preview Update Set** tab.

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/preview-update-set.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=a9065a14709d6910c5ba7d9c691e08f3" alt="preview-update-set" width="1849" height="931" data-path="ai-for-service/agentai/integration/servicenow/images/preview-update-set.png" />

#### Commit Update Set

This option becomes available after a successful preview. Click **Commit Update Set** to proceed.

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/commit-update-set.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=517e78c054868e03ec4a72724848f2a1" alt="commit-update-set" width="1853" height="144" data-path="ai-for-service/agentai/integration/servicenow/images/commit-update-set.png" />

##### Tips

If you get any error (refer to the following screenshot) in the preview step, perform the following steps to resolve it.

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/update-set-preview-error.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=9d34be0a5c5258c554f115e6a857e074" alt="update-set-preview-error" width="1835" height="349" data-path="ai-for-service/agentai/integration/servicenow/images/update-set-preview-error.png" />

Steps to resolve the error:

* Close the **Update Set Preview** dialog window.
* Go to **Update Set Review Problems**, and select all.
* On the right side of the page, select **Accept remote update** from the **Action on selected rows…** drop-down list.

  <Note>**Multi-language support** for Agent AI is available only with the **Update Set**.</Note>

### Step 2: Set Up Agent AI Application Configuration

Application Name: **Agent AI by kore.ai**

This section outlines the steps to configure the Agent AI app. With the multibot solution in ServiceNow, you can configure multiple Agent AI bots. The system renders the appropriate bot when a chat enters a specific ServiceNow queue.

#### Add Agent configuration in the ServiceNow Custom Table

1. Change your ServiceNow scope from **Global** to **Agent AI by kore.ai**.

2. Go to **All** > **Filter navigator**, and search **Kore\_configuration**> **kore-config-customtable**.

   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/kore-config-customtable.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=86c356c6634ff46dbbcad252e92de6d1" alt="kore-config-customtable" width="1840" height="334" data-path="ai-for-service/agentai/integration/servicenow/images/kore-config-customtable.png" />

3. Click **New**.

4. Add the **Agent AI URL**, **Bot Id**, **Client Id**, **Client Secret**, **Language Code**, and **Queue Name**. Refer to [Prerequisite](#prerequisites).
   * **Language Code**: For any language other than English, select the language code from the drop-down list. The default language code is English (En).
   * **Queue Name:** To configure the same AI Agent credentials for multiple queues, use comma-separated queue names (for example, customer\_queue, sales\_queue, service\_queue).

5. Click **Submit**.

   <Note>The **Client Secret** and **AAtoken** field must be empty for the widget to load. The AAtoken field automatically populates at the runtime.</Note>

   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/aatoken.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=c890135440ef1e5dbed8a9adbddd24be" alt="aatoken" width="1853" height="409" data-path="ai-for-service/agentai/integration/servicenow/images/aatoken.png" />

#### V2-V3 Migration

* For version 2 (v2) of Agent AI, `https://agentassist.kore.ai` (or the domain where the Agent AI is hosted), you should add this to the Agent AI URL.
  Sample v2 URL: `https://<domain-name>.kore.ai`

* For version 3 (v3), you must copy the Agent AI widget URL from the Agent UXO v11 Channel configuration and paste it into the Agent AI URL field. For XO v11, go to **Flows and Channels** > **Channels** > **Digital** > **Web/Mobile Client** > **JWT App Details**.

  Sample v3 URL: `https://<domain-name>.kore.ai/koreagentassist-sdk-v3/UI/agentassist-iframe.html`

### Step 3: Test the Integration

* **Agent**: Sign in to the ServiceNow Agent Console/Workspace (For example, Service Operation Workspace) with your agent credentials (agent-specific permissions) and remain available to receive chat on the ServiceNow desktop.
  * Minimum permissions/roles required for an agent are **Itil** and **awa\_agent**.

* **Customer**: To initiate a chat from the customer side, sign in to **ESC (Enterprise Service Center)** of your ServiceNow instance and initiate a chat.

  <Note>ESC portal link: `<ServiceNow domain>/esc`.</Note>

  <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/chat-initiate.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=d7a249e0031c8ce0fab7a154159a68c3" alt="Chat Initiate" width="1844" height="945" data-path="ai-for-service/agentai/integration/servicenow/images/chat-initiate.png" />

* **Agent:** Once the agent accepts the incoming chat, an Interaction Record page opens, and the **Agent AI by Kore** is the first icon on the Contextual side panel.

  * The agent gets a notification of the incoming chat.
    <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/incoming-chat-notification.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=929521ff39b943b931ff671277023f97" alt="incoming-chat-notification" width="1851" height="968" data-path="ai-for-service/agentai/integration/servicenow/images/incoming-chat-notification.png" />

  * Once the agent accepts the chat, the Agent AI widget appears on the right Contextual side panel.

    <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/agent-ai-contextual-panel.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=807b0f71e49a53b3df83d67591e545c4" alt="agent-ai-contextual-panel" width="1851" height="967" data-path="ai-for-service/agentai/integration/servicenow/images/agent-ai-contextual-panel.png" />

  * Once a conversation ends, the Agent AI widget generates the conversation summary.

    <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/agent-ai-conversation-summary.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=f0eac4dcf533ba14ee66de95f567bbee" alt="agent-ai-conversation-summary" width="1850" height="965" data-path="ai-for-service/agentai/integration/servicenow/images/agent-ai-conversation-summary.png" />

### Step 4: XO Configuration (Optional)

You need this step if the chat client routes through the XO AI Agent builder, and post agent transfer, it lands into the ServiceNow Agent workspace. For more information, refer to [Configuring the ServiceNow Agent - Utah and Higher versions](/ai-for-service/integrations/agents/servicenow/configuring-the-servicenow-agent-utah-and-vancouver#configuring-the-servicenow-agent-utah-and-higher-versions).

To pass the language code and custom data dynamically from XO to the Agent AI widget inside ServiceNow, add the following JavaScript code inside a script node of XO dialog task before the Agent Transfer node of ServiceNow. Without this script node, the language code and custom data won't be automatically sent to the Agent AI widget. To access custom data in the Agent AI widget, refer to the [Access Custom Data in Agent AI App](/ai-for-service/agentai/agent-experience/access-custom-data-in-agent-ai) doc.

The following example shows how to pass data to Agent AI using the `customdata` field:

```
let metaData = {
	"payloadFields" : {
    		"langCode":context.currentLanguage,
		"customdata": {
			"userId": context.session.BotUserSession.userId
		}
	},
	"headerFields" : {
    		"token" : ""
	}
}
agentUtils.setMetaInfo("ServiceNowMetaData", JSON.stringify(metaData));
```

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/script-node.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=6cdc929bafe9e2625e281bddd55b78e2" alt="Language Code" width="2048" height="1106" data-path="ai-for-service/agentai/integration/servicenow/images/script-node.png" />

<Note>If a Language Code is sent from XO to ServiceNow, then the Agent AI widget will load according to that language code. So, the XO language code will always take precedence over the language code set inside the ServiceNow custom table in Step 2.</Note>

### Step 5: Using the Agent AI widget

From the integration perspective, along with all the features and capabilities of Agent AI [Introduction to Agent AI](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3), agents on ServiceNow have the flexibility to use the following additional features:

* **Send / Copy Buttons:** Agents can use the **Send** and **Copy** buttons on the Agent AI UI to directly send and copy data from the Agent AI widget to the customer.

* **Conversation Summary / End Of Conversation**: The conversation summary appears in the **Summary** box of the Agent AI widget after the conversation ends. Agents can copy the summary to their notepad or save it. When agents select **Submit Summary**, the system saves the summary in the interaction table for that conversation.
  <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/submit-summary.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=0ddf6b31adf244aeed284115edf04967" alt="send-copy-button" width="1849" height="877" data-path="ai-for-service/agentai/integration/servicenow/images/submit-summary.png" />

* **Conversation logs:** Agents or supervisors can check the chat transcript along with the Agent AI summary on the Interaction record page.
  <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/conversation-logs.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=fef86acf158927c6487a54f5b95c8f24" alt="send-copy-button" width="1849" height="876" data-path="ai-for-service/agentai/integration/servicenow/images/conversation-logs.png" />

#### Additional Configuration for HR Agent Workspace (Optional)

Follow this step only if you use the HR Agent Workspace to receive incoming chats in ServiceNow:

1. Sign in to the **Servicenow** instance.
2. Search in the **All** > **Filter** navigator.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/filter-navigator-3.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=e906a78a0d5f62316a1e246a4f8e1c62" alt="filter-navigator" width="1905" height="281" data-path="ai-for-service/agentai/integration/servicenow/images/filter-navigator-3.png" />
3. Go to **UI Builder** > **Experiences**.
4. Filter with **HR Agent Workspace**, and open it.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/hragent-workspace-4.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=fcbc8b829779ed2f44f27fd8ab4b089a" alt="hragent-workspace" width="1914" height="307" data-path="ai-for-service/agentai/integration/servicenow/images/hragent-workspace-4.png" />
5. Search with **Case SRP variant** (under the **Record** page).
6. Create a copy of **Case SRP variant**, if the above one is read only.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/record-5.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=dc168f5b01e0f0086b183a30ef4c6ec4" alt="record" width="1844" height="88" data-path="ai-for-service/agentai/integration/servicenow/images/record-5.png" />
7. Open the **settings** of **Case SRP copy** and change the value of **Order** to **10**.
   <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/case-srp-copy.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=8831f0c22dd95892818c9e69eac55855" alt="case-srp-copy" width="1260" height="758" data-path="ai-for-service/agentai/integration/servicenow/images/case-srp-copy.png" />
8. Open the editor for **Case SRP copy**, and add the **KoreaiWidget** component to the right sidebar. Follow these steps:
   1. Go to **Body** > **Resizable panes** > **right** > **Tab sidebar**

   2. **Add** a new tab (preferably, select **start from an empty container**).
      <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/tab-sidebar-6.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=ec74116c3e37160843dd9250d85108ef" alt="tab-sidebar" width="321" height="850" data-path="ai-for-service/agentai/integration/servicenow/images/tab-sidebar-6.png" />

   3. Drag that **TAB** to the top of the list.

   4. Add **Kore AgentAI ui-component** to that TAB (search with **KoreaiWidget**).

   5. Click that component to change its styles:
      * Flex : Grow
      * Alignment: Stretch
      * Sizing (Width: 100%, Height: 100%, Min Height: 100%). Keep other properties empty.
        <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/component-style-change-7.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=3d53bfec859779fbab53362abee579ff" alt="component-style-change" width="1847" height="875" data-path="ai-for-service/agentai/integration/servicenow/images/component-style-change-7.png" />

   6. To render the widget vertically and take up the full height of the workspace, set the height of the parent TAB (Eg- KoreAA-HR) to 100%.
      <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/parent-tab-8.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=bb9bc6ca91c944ed8a7503547fc2e15c" alt="parent-tab" width="1847" height="839" data-path="ai-for-service/agentai/integration/servicenow/images/parent-tab-8.png" />

   7. Perform the following steps to proceed with Data Binding (sysId):
      1. Click the **KoreaiWidget** again.
      2. Update **Config** > **sysId** as following:

         * Change the input option to **Bind Data**.
         * Type '@context.props.sysId' (you get an auto suggestion).
           <img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/data-binding-9.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=8274bc8ff287a4e9dfe8d8249f69586e" alt="data-binding" width="1844" height="968" data-path="ai-for-service/agentai/integration/servicenow/images/data-binding-9.png" />

         <Note>You must complete this step to dynamically send the **sysid** of the current interaction to the Agent AI UI component. Although the solution includes a fallback method, you should not skip the Data Binding step. If you skip it, concurrent chats handled by a single agent can lose context during page reloads or network latency.</Note>

   8. Once the changes are done, click **Save**.

### Widget Configuration and Scope Requirements

* **Widget icon:** ServiceNow doesn't automatically add the widget icon. You must configure it manually due to a ServiceNow limitation.
* **Widget scope:** Use the **Agent AI by Kore.ai** scope to ensure safer upgrades. Although the **Global** scope works, it doesn't support long-term maintainability.
* **Per-workspace requirement:** Each workspace requires its own widget/icon configuration.

### No Widget for Inactive Conversation

The multibot solution includes an additional feature that hides the widget when no conversation is active. The following screen appears when there is no active conversation:

<img src="https://mintcdn.com/koreai/QMFg8VtHu7wMGzMa/ai-for-service/agentai/integration/servicenow/images/widget-unavailable-10.png?fit=max&auto=format&n=QMFg8VtHu7wMGzMa&q=85&s=f758f65a7010868f556940a356b28738" alt="widget-unavailable" width="1847" height="967" data-path="ai-for-service/agentai/integration/servicenow/images/widget-unavailable-10.png" />

***
