> For the complete documentation index, see [llms.txt](https://developer.kizen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.kizen.com/docs/integrations-and-plugins/integrations/zendesk/retrieve-zendesk-data-in-an-agentic-workflow.md).

# Retrieve Zendesk Data in an Agentic Workflow

Load live ticket and user data from the Zendesk platform directly into Kizen through Agentic Workflow action steps.

{% hint style="success" %}
**Audience:** Admins, Developers, Solution Architects

**Purpose:** Explains how to use <code class="expression">space.vars.automations</code> in <code class="expression">space.vars.Kizen\_company\_name</code> to retrieve live ticket and user data from the Zendesk platform
{% endhint %}

## Overview

{% hint style="warning" %}
**Caution:** This setup reflects Kizen's default configuration. Your administrator may have customized your layout, so columns or navigation may appear differently. Trial accounts may have limited features.
{% endhint %}

With the Zendesk integration, you can load ticket and user data from the Zendesk® platform directly into <code class="expression">space.vars.Kizen\_company\_name</code> for use in <code class="expression">space.vars.automations</code>.

***

## Before You Begin

To retrieve Zendesk data in an <code class="expression">space.vars.automation</code>, you need an active, authenticated connection to the Zendesk platform.

See [Set Up Zendesk in Kizen](/docs/integrations-and-plugins/integrations/zendesk/set-up-zendesk-in-kizen.md) for details.

***

## Retrieve Zendesk Data in an Agentic Workflow

To retrieve Zendesk data in an <code class="expression">space.vars.automation</code>:

{% stepper %}
{% step %}

#### Go to the Agentic Workflow builder

In the global navigation, select **Agentic Workflows**. Then, to open the builder, do one of the following:

* Select **New Agentic Workflow**.
* Select the name of an existing <code class="expression">space.vars.automation</code>.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FOAaCVoAMNcY3AsVQOfoU%2Fglobal_newagenticworkflow.png?alt=media&amp;token=7af2b9a3-d223-45a2-961a-5c881cf623cf" alt="The New Agentic Workflow button on the Agentic Workflows page" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Add an action to the workflow

Select **+**, and then select **Add Action**.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2F4I4RYiryLGZqxzqBUpsT%2Fglobal_addaction.png?alt=media&amp;token=4c641727-01fc-4dd4-b533-a58ed1e08a61" alt="The Add Action context menu item in the Agentic Workflow builder" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Select the Zendesk action

In the Add Action modal that opens, scroll to the Integration section, and select the Zendesk connector card.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FWUHnFpzzU5eWvhF2qoyP%2Faddaction_zendesk.png?alt=media&amp;token=52bafd9f-08ee-4d51-90ce-d50be5014d83" alt="The Zendesk connector card on the Add Action modal" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Choose the function to perform

In the Action Settings section of the Add Action modal, select the **Action** dropdown menu, and do one of the following:

* To return information about a specific Zendesk ticket, select **Get Ticket**, and set up the action. For more information, see [Set Up a Get Ticket Action](#set-up-a-get-ticket-action) below.
* To return a Zendesk ticket's comment thread, select **Get Ticket Comments**, and set up the action. For more information, see [Set Up a Get Ticket Comments Action](#set-up-a-get-ticket-comments-action) below.
* To return one or more Zendesk tickets based on search criteria, select **Search Tickets**, and set up the action. For more information, see [Set Up a Search Tickets Action](#set-up-a-search-tickets-action) below.
* To return a specific Zendesk user, or to create this user if they don't exist, select **Find or Create User**, and set up the action. For more information, see [Set Up a Find or Create User Action](#set-up-a-find-or-create-user-action) below.
  {% endstep %}

{% step %}

#### Configure error handling

In the Error Handling section of the modal, specify how to handle errors in this step of the <code class="expression">space.vars.automation</code>.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FGzhPBGaxlzsW1tWJMZYU%2FScreenshot%202026-07-16%20at%209.13.52%E2%80%AFAM.png?alt=media&amp;token=5dc5daed-6009-44f6-8120-e7124eb6aee8" alt="The error handling options in the Add Action modal" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Save the Zendesk action

Select **Save**.
{% endstep %}
{% endstepper %}

***

## Set Up a Get Ticket Action

The Get Ticket action returns information about the specified Zendesk ticket.

To set up a Get Ticket action:&#x20;

{% stepper %}
{% step %}

#### Configure the source for the ticket ID

Find the Ticket ID field in the Script Inputs section of the modal, open its **Input Source** dropdown menu, select the source of the ticket ID string, and then configure this source with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FyAUJ3GUeEo2n4nq7A4Lp%2Fzendesk_getticket_inputs.png?alt=media&amp;token=ea25ef2b-2109-4a38-ad05-6c8d4181a1cf" alt="The script inputs for the Get Ticket action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the **Output Destination** dropdown menu, and then configure the destination with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2Flj5PI1V4PPuaZFv4Y2pB%2Fzendesk_getticket_outputs.png?alt=media&amp;token=60a7e996-feb3-4540-a66f-5f2e86953007" alt="The script outputs for the Get Ticket action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

<table data-search="false"><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required?</th></tr></thead><tbody><tr><td><strong>Assignee ID</strong></td><td><code>String</code></td><td>The ID of the Zendesk user assigned to remediate the ticket</td><td>No</td></tr><tr><td><strong>Created At</strong></td><td><code>DateTime</code></td><td>The date and time when the ticket was created</td><td>No</td></tr><tr><td><strong>Description</strong></td><td><code>String</code></td><td>The body of the ticket</td><td>No</td></tr><tr><td><strong>External ID</strong></td><td><code>String</code></td><td>The <code class="expression">space.vars.Kizen_company_name</code> ID of the integration user</td><td>No</td></tr><tr><td><strong>Group ID</strong></td><td><code>String</code></td><td>The ID of the group associated with the requester</td><td>No</td></tr><tr><td><strong>Organization ID</strong></td><td><code>String</code></td><td>The ID of the organization associated with the requester</td><td>No</td></tr><tr><td><strong>Priority</strong></td><td><code>String</code></td><td>The priority of the ticket</td><td>No</td></tr><tr><td><strong>Requester Email</strong></td><td><code>Email</code></td><td>The email address of the Zendesk user who opened the ticket</td><td>No</td></tr><tr><td><strong>Requester ID</strong></td><td><code>String</code></td><td>The ID of the Zendesk user who opened the ticket</td><td>No</td></tr><tr><td><strong>Status</strong></td><td><code>String</code></td><td>The status of the ticket</td><td>No</td></tr><tr><td><strong>Tags</strong></td><td><code>String</code></td><td> A comma-separated list of tags associated with the ticket</td><td>No</td></tr><tr><td><strong>Ticket Title</strong></td><td><code>String</code></td><td>The title of the ticket</td><td>No</td></tr><tr><td><strong>Ticket Type</strong></td><td><code>String</code></td><td>The type of the ticket</td><td>No</td></tr><tr><td><strong>Ticket URL</strong></td><td><code>String</code></td><td>The URL of the ticket</td><td>No</td></tr><tr><td><strong>Updated At</strong></td><td><code>DateTime</code></td><td>The date and time when the ticket was last updated</td><td>No</td></tr></tbody></table>
{% endstep %}
{% endstepper %}

***

## Set Up a Get Ticket Comments Action

The Get Ticket Comments action returns the text of up to 1,000 comments from the conversation thread of the specified Zendesk ticket. The action also returns the most recent comment separately, along with information about its author and visibility.

To set up a Get Ticket Comments action:&#x20;

{% stepper %}
{% step %}

#### Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the **Input Source** dropdown menu, and then configure the source with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FQliwprm9CHHcus90GnW0%2Fzendesk_getticketcomment_inputs.png?alt=media&amp;token=61e4a89c-206b-46e2-b683-c00156d29178" alt="The script inputs for the Get Ticket Comments action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

| Field           | Type      | Description                                                                                                                                                         | Required? |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Limit**       | `String`  | The maximum number of comments to return, starting from the most recent. The default value is `100`. The maximum value is `1000`.                                   | No        |
| **Public Only** | `Boolean` | Whether the integration omits (`true`) or includes (`false`) internal notes in the comment thread. If you don't select a value, the integration defaults to `false` | No        |
| **Ticket ID**   | `String`  | The ID of the ticket associated with the comments.                                                                                                                  | Yes       |
| {% endstep %}   |           |                                                                                                                                                                     |           |

{% step %}

#### Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the **Output Destination** dropdown menu, and then configure the destination with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2Foo1ey4HubDda5YcdZ143%2Fzendesk_getticketcomment_outputs.png?alt=media&amp;token=5faa80f0-5f8f-454e-9278-38252a3dc1b9" alt="The script outputs for the Get Ticket Comments action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

| Field                      | Type      | Description                                                | Required? |
| -------------------------- | --------- | ---------------------------------------------------------- | --------- |
| **Last Comment Author ID** | `String`  | The ID of the author of the most recent comment            | No        |
| **Last Comment Body**      | `String`  | The body of the most recent comment                        | No        |
| **Last Comment Is Public** | `Boolean` | Whether the most recent comment is available to the public | No        |
| **Comment Count**          | `Number`  | The total number of comments returned                      | No        |
| **Thread Text**            | `String`  | All the returned comments in a single thread               | No        |
| {% endstep %}              |           |                                                            |           |
| {% endstepper %}           |           |                                                            |           |

***

## Set Up a Search Tickets Action

The Search Tickets action returns a subset of Zendesk tickets based on the specified search criteria or a raw SQL statement.

{% hint style="info" %}
**Note:** If you don't provide any search criteria, the integration returns the 100 most recently created tickets in descending order from their creation date. If you want more (or fewer), specify a value for the **Limit** input field. The maximum is `1000`.
{% endhint %}

To set up a Search Tickets action:&#x20;

{% stepper %}
{% step %}

#### Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the **Input Source** dropdown menu, and then configure the source with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FjAAgHGgh13ATzhudDOKG%2Fzendesk_searchtickets_inputs.png?alt=media&amp;token=25d9eba2-2576-49a4-ae95-c28a8050663b" alt="The script inputs for the Search Tickets action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

<table data-search="false"><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required?</th></tr></thead><tbody><tr><td><strong>Created After</strong></td><td><code>DateTime</code></td><td>The earliest ticket creation time to include in the results.</td><td>No</td></tr><tr><td><strong>External ID</strong></td><td><code>String</code></td><td>The <code class="expression">space.vars.Kizen_company_name</code> ID of the user associated with the search.</td><td>No</td></tr><tr><td><strong>Limit</strong></td><td><code>String</code></td><td>The maximum number of tickets to return, starting from the most recent. The default value is <code>100</code>. The maximum value is <code>1000</code>.</td><td>No</td></tr><tr><td><strong>Organization ID</strong></td><td><code>String</code></td><td>The ID of the organization associated with the requester by which to target the search.</td><td>No</td></tr><tr><td><strong>Priority</strong></td><td><code>String</code></td><td>The priority of the ticket by which to target the search.</td><td>No</td></tr><tr><td><strong>Raw Query</strong></td><td><code>String</code></td><td>The SQL query to use to return the results.</td><td>No</td></tr><tr><td><strong>Requester Email</strong></td><td><code>Email</code></td><td>The email address of the requester by which to target the search.</td><td>No</td></tr><tr><td><strong>Status</strong></td><td><code>String</code></td><td>The status of the ticket by which to target the search.</td><td>No</td></tr><tr><td><strong>Tags</strong></td><td><code>String</code></td><td>A comma-separated list of tags by which to target the search.</td><td>No</td></tr><tr><td><strong>Ticket Type</strong></td><td><code>String</code></td><td>The type of the ticket by which to target the search.</td><td>No</td></tr><tr><td><strong>Updated After</strong></td><td><code>DateTime</code></td><td>The earliest ticket update time to include in the results.</td><td>No</td></tr></tbody></table>

In most cases, these inputs represent search conditions. For example, specifying `closed` for the **Status** field returns only those tickets whose status is `closed`. Similarly, supplying a value for the **Updated After** field limits the results to those tickets updated after the specified date. The **Raw Query** field is different in that it takes a SQL statement to use as the exact selector for search results, while the **Limit** field returns a subset of matches.&#x20;

{% hint style="info" %}
**Note:** If you search by multiple tags, a match occurs with any one of the tags, not all of them. For example, searching for `red,green,blue` returns a match with any ticket tagged `red`, `green`, or `blue` individually, or any combination of these.
{% endhint %}
{% endstep %}

{% step %}

#### Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the **Output Destination** dropdown menu, and then configure the destination with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FpcpqNs9I1aaFRQNWvEul%2Fzendesk_searchtickets_outputs.png?alt=media&amp;token=5166c2a6-05aa-41dd-b0ba-ad71fd51abff" alt="The script outputs for the Search Tickets action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

| Field            | Type     | Description                                          | Required? |
| ---------------- | -------- | ---------------------------------------------------- | --------- |
| **Count**        | `Number` | The number of tickets returned in the search results | No        |
| **Tickets**      | `String` | A stringified JSON array of the search results       | No        |
| {% endstep %}    |          |                                                      |           |
| {% endstepper %} |          |                                                      |           |

***

## Set Up a Find or Create User Action

The Find or Create User action searches for the specified Zendesk user in this order:

1. The Zendesk user ID
2. The external user ID
3. The user's email address
4. The user's name

{% hint style="info" %}
**Note:** Searching for a user by name yields fuzzy matches. For example, searching for *Ralph* matches both Ralph Waldo Emerson and Ralph Macchio.
{% endhint %}

If none of these identifiers yields a match, you can create the user in the Zendesk platform.

To set up a Find or Create User action:&#x20;

{% stepper %}
{% step %}

#### Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the Add Action modal, select the source of the field's value from the **Input Source** dropdown menu, and then configure the source with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2Fa9QLiKIjJiDjnpv3O3jo%2Fzendesk_findorcreateuser_inputs.png?alt=media&amp;token=eb40bdfa-1e8f-460f-8dde-87d98075d218" alt="The script inputs for the Find or Create User action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

<table data-search="false"><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Required?</th></tr></thead><tbody><tr><td><strong>Create If Missing</strong></td><td><code>Boolean</code></td><td>Whether to create the user if no record exists</td><td>No</td></tr><tr><td><strong>Email</strong></td><td><code>Email</code></td><td>The email address of the user to find</td><td>No</td></tr><tr><td><strong>External ID</strong></td><td><code>String</code></td><td>The <code class="expression">space.vars.Kizen_company_name</code> ID of the user to find</td><td>No</td></tr><tr><td><strong>Name</strong></td><td><code>String</code></td><td>The name of the user to find</td><td>No</td></tr><tr><td><strong>Organization ID</strong></td><td><code>String</code></td><td>The ID of the organization associated with the user to find</td><td>No</td></tr><tr><td><strong>Phone</strong></td><td><code>String</code></td><td>The phone number associated with the user to find</td><td>No</td></tr><tr><td><strong>Zendesk User ID</strong></td><td><code>String</code></td><td>The Zendesk ID of the user to find</td><td>No</td></tr></tbody></table>
{% endstep %}

{% step %}

#### Configure the destinations for the script outputs

For each of the fields in the Script Outputs section of the modal, select the destination of the field's value from the **Output Destination** dropdown menu, and then configure the destination with the additional controls that appear.

<div data-with-frame="true"><figure><img src="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FIUmBqwhh2cSI1YwXUFzL%2Fzendesk_findorcreateuser_outputs.png?alt=media&amp;token=75371ede-2b2b-41d9-a3f5-bff61a6dbf1a" alt="The script outputs for the Find or Create User action in the Add Action modal" width="563"><figcaption></figcaption></figure></div>

The fields are as follows:

| Field               | Type      | Description                                                                                 | Required? |
| ------------------- | --------- | ------------------------------------------------------------------------------------------- | --------- |
| **Email**           | `Email`   | The email address of the user                                                               | No        |
| **Name**            | `String`  | The name of the user                                                                        | No        |
| **Organization ID** | `String`  | The ID of the organization associated with the user                                         | No        |
| **Role**            | `String`  | The role associated with the user                                                           | No        |
| **User ID**         | `String`  | The Zendesk ID of the user                                                                  | No        |
| **Was Created**     | `Boolean` | Whether the integration created the user after it didn't find a match with an existing user | No        |
| {% endstep %}       |           |                                                                                             |           |
| {% endstepper %}    |           |                                                                                             |           |

***

## What's Next

Continue to [Create or Update Zendesk Data in an Agentic Workflow](/docs/integrations-and-plugins/integrations/zendesk/create-or-update-zendesk-data-in-an-agentic-workflow.md) to learn how to push data from <code class="expression">space.vars.Kizen\_company\_name</code> to the Zendesk platform through <code class="expression">space.vars.automations</code>.

<details>

<summary><strong>Related Topics</strong></summary>

* [Zendesk](/docs/integrations-and-plugins/integrations/zendesk.md)
* [Set Up Zendesk in Kizen](/docs/integrations-and-plugins/integrations/zendesk/set-up-zendesk-in-kizen.md)
* [Create or Update Zendesk Data in an Agentic Workflow](/docs/integrations-and-plugins/integrations/zendesk/create-or-update-zendesk-data-in-an-agentic-workflow.md)
* [Troubleshoot Zendesk](/docs/integrations-and-plugins/integrations/zendesk/troubleshoot-zendesk.md)

</details>

***

*Zendesk® and the stylized Z logo are registered trademarks of Zendesk, Inc. Kizen's Zendesk integration is not affiliated with, sponsored by, or endorsed by Zendesk, Inc.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.kizen.com/docs/integrations-and-plugins/integrations/zendesk/retrieve-zendesk-data-in-an-agentic-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
