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

# Communicate With Glean

Send contextual messages to Glean AI for a response.

**Note**, this action belongs to `Glean Chat API`, therefore requires using either the `Global Client Token` or the `User Client Token` connection methods.

<Note>
  External Documentation

  To learn more, visit the [Glean documentation](https://developers.glean.com/api/client-api/chat/chat).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Agent Mode      | The mode of the agent that executes the request. For more information, please refer to [Glean's documentation](https://developers.glean.com/api/client-api/chat/chat).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | Agent Name      | The name of the agent that executes the request. For more information, please refer to [Glean's documentation](https://developers.glean.com/api/client-api/chat/chat).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | Chat ID         | The ID of the Chat that context should be retrieved from and messages added to. Can be obtained by using the `List Chats` action. An empty ID starts a new Chat, and the Chat is saved if `Save Chat` is `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | Messages        | Messages containing queries to prompt Glean for a response. The official reply will be included in the `messages` attribute of the response, within the `last` message object.<br /><br />**Note**: It is recommended to either send a single message at a time or include a few messages that pertain to the same subject/context. You can also provide context by including chat history using the `Get Chat By ID` action.<br /><br />Example:<br /><pre><code>\[<br />    \{<br />      "author": "USER",<br />      "messageType": "CONTENT",<br />      "fragments": \[<br />        \{<br />          "text": "What are the company holidays this year?"<br />        }<br />      ]<br />    }<br />  ]</code></pre>For more information on messages, please refer to [Glean's documentation](https://developers.glean.com/api/client-api/chat/chat). |
  | Save Chat       | Save the current interaction as a Chat for the user to access and potentially continue later.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | Timezone Offset | The offset of the client's timezone in minutes from UTC. For example, `PTD` is `-420` because it's 7 hours behind `UTC`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter      | Description                                                                                                                                                                                                                                    |
  | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Application ID | The ID of the application this request originates from, used to determine the configuration of underlying chat processes. This should correspond to the ID set during admin setup. If not specified, the default chat experience will be used. |
  | Timeout Millis | Timeout in milliseconds for the request. A `408` error will be returned if handling the request takes longer.                                                                                                                                  |
</div>

## Example Output

```json theme={"dark"}
{
	"messages": [
		{
			"author": "GLEAN_AI",
			"messageType": "CONTENT",
			"hasMoreFragments": false,
			"agentConfig": {
				"agent": "DEFAULT",
				"mode": "DEFAULT"
			},
			"fragments": [
				{
					"text": "There are no holidays!"
				}
			]
		}
	]
}
```

## Workflow Library Example

[Communicate with Glean and Send Results Via Email](https://library.blinkops.com/workflows/communicate-with-glean-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/communicate-with-glean-and-send-results-via-email/canvas" />
</div>
