> 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/snowflake/add-snowflake-data-to-an-agentic-workflow.md).

# Add Snowflake Data to an Agentic Workflow

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

**Purpose:** Explains how to read and write Snowfake data from an <code class="expression">space.vars.automation</code> to query or update your external warehouse
{% 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 %}

After you set up the Snowflake integration in <code class="expression">space.vars.Kizen\_company\_name</code>, you can read and write Snowflake data directly from <code class="expression">space.vars.automations</code> with the Read Data and Write Data actions.

***

## Before You Begin

To add Snowflake data to an <code class="expression">space.vars.automation</code>, you need:

* A Snowflake connection to <code class="expression">space.vars.Kizen\_company\_name</code>. See [Enable Snowflake in Kizen](/docs/integrations-and-plugins/integrations/snowflake/enable-snowflake-in-kizen.md) for details.
* A Snowflake role with `USAGE` privileges on the target warehouse and database and read or write privileges on the target database tables as needed.&#x20;

***

## Add Snowflake Data to an Agentic Workflow

To add Snowflake data to 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="/files/9JMIsIfEsrYi5QOR4H3j" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Add an action to the Agentic Workflow

In the builder, select **+**, and then select **Add Action**.

<div data-with-frame="true"><figure><img src="/files/BxulYWF4l66mXuLSQ76x" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Select the Snowflake Connection action

In the Add Action modal that appears, scroll to the Integration section, and select the Snowflake connection card.

<div data-with-frame="true"><figure><img src="/files/s2nl5yGjejfbq5alRmSF" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Choose whether to read or write Snowflake data

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

* To read Snowflake data, select **Read Data**.
* To write Snowflake data, select **Write Data**.

<div data-with-frame="true"><figure><img src="/files/ZH4egx7r4yhP7wkeySkK" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
**Caution:** The Write Data action can insert, update, or delete data in your Snowflake warehouse. Validate your query in a non-production environment before running it against production data.
{% endhint %}
{% endstep %}

{% step %}

#### Configure the sources for the script inputs

For each of the fields in the Script Inputs section of the 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="/files/BvgyxtLcQZ430RbaW0PW" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note:** The order of the fields on the screen depends on whether you selected the Read Data or Write Data action.
{% endhint %}

The fields are as follows:

| Field                     | Type      | Description                                                                                                                                                               | Required?                                 |
| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| **Query**                 | `String`  | The `SELECT` statement to execute.                                                                                                                                        | Yes                                       |
| **Connection Secret Tag** | `String`  | The name of the Snowflake environment from your integration secret to execute the query on. Configure this source when you have more than one environment in your secret. | Not in a single-environment configuration |
| **Return Single Value**   | `Boolean` | Whether you expect to return a single value (`true`) or multiple values (`false`).                                                                                        | Yes                                       |
| **Database**              | `String`  | The name of the target database in Snowflake.                                                                                                                             | Yes                                       |

{% hint style="info" %}
**Note:** Always use the `LIMIT` clause in `SELECT` queries against large tables. Results sets larger than 5 MB might be truncated or cause memory issues.
{% 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="/files/qTsEXRo5OY9v2gK9zkmx" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note:** The Read Data action uses only the Result field as a script output. The Write Data action uses both Result and Result Status.
{% endhint %}

The fields are as follows:

| Field             | Type     | Action                | Description                       | Required? |
| ----------------- | -------- | --------------------- | --------------------------------- | --------- |
| **Result**        | `String` | Read Data             | The result of the query           | Yes       |
| **Result Status** | `String` | Read Data, Write Data | The status of the write operation | Yes       |
| {% 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>.
{% endstep %}

{% step %}

#### Save the Snowflake Connection action

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

***

## What's Next

Your <code class="expression">space.vars.automation</code> can now read from or write to your Snowflake database. For details on how to fix common technical issues, continue to [Troubleshoot Snowflake](/docs/integrations-and-plugins/integrations/snowflake/troubleshoot-snowflake.md).

<details>

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

* [Snowflake](/docs/integrations-and-plugins/integrations/snowflake.md)
* [Enable Snowflake in Kizen](/docs/integrations-and-plugins/integrations/snowflake/enable-snowflake-in-kizen.md)
* [Troubleshoot Snowflake](/docs/integrations-and-plugins/integrations/snowflake/troubleshoot-snowflake.md)

</details>

***

*Snowflake and all other Snowflake product, feature, and service names mentioned herein are registered trademarks or trademarks of Snowflake Inc. in the United States and other countries. Kizen's Snowflake integration is not affiliated with, sponsored by, or endorsed by Snowflake 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.kizen.com/docs/integrations-and-plugins/integrations/snowflake/add-snowflake-data-to-an-agentic-workflow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
