> 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-apps/integrations/amazon-s3/work-with-amazon-s3-files-in-an-agentic-workflow.md).

# Work with Amazon S3 Files in an Agentic Workflow

Upload Kizen files to Amazon Simple Storage Service, copy files and file content, and create presigned upload and download links, all automatically and in real time.

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

**Purpose:** Describes six new action steps in <code class="expression">space.vars.Kizen\_company\_name</code>'s <code class="expression">space.vars.automation</code> builder for working with live Amazon S3 data
{% 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 %}

Once you configure the connection between Amazon Simple Storage Service (S3) and <code class="expression">space.vars.Kizen\_company\_name</code> through the Amazon S3 integration, you can work with live S3 data in <code class="expression">space.vars.automations</code>.

***

## Before You Begin

To work with Amazon S3 files in an <code class="expression">space.vars.automation</code>, you need an active S3 connection in <code class="expression">space.vars.Kizen\_company\_name</code>. See [Set Up Amazon S3 in Kizen](/docs/integrations-and-apps/integrations/amazon-s3/set-up-amazon-s3-in-kizen.md) for details.

***

## Work with Amazon S3 Files an Agentic Workflow

To work with Amazon S3 files 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%2FmGY4T9nPsz6M1Yixhckg%2Fglobal_newagenticworkflow.png?alt=media&amp;token=61f7db6e-276b-4535-b743-71a7d9ff234d" alt="The New Agentic Workflow button on the Agentic Workflows page" 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="https://3898351136-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQd8ufpN7wkdnx7JtgoeZ%2Fuploads%2FRU6mGUYeAjXtxNh38YaX%2Fglobal_addaction.png?alt=media&amp;token=8824261c-9bd8-408d-966c-483cbf07a31a" alt="The Add Action context menu item in the Agentic Workflow builder" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

#### Select Amazon S3

In the Add Action modal that appears, scroll to the Integration section, and select the Amazon S3 card.
{% endstep %}

{% step %}

#### Choose the action to perform

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

* To write a <code class="expression">space.vars.Kizen\_company\_name</code> file to an Amazon S3 bucket, select **Upload File**.
* To create an identical <code class="expression">space.vars.Kizen\_company\_name</code> file from an S3 file, select **Get File Content**.
* To return details about an S3 file, select **Get File Metadata**.
* To return a list of S3 files by folder, select **List Files**.
* To create a server-side copy of an S3 file, select **Copy File**.
* To create an upload or download URL for Amazon S3, select **Generate Presigned URL**.

Then, to set up the action, specify the source and destination for each input and output field. For detailed descriptions of these inputs and outputs, see the sections for each individual action below.

<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%2FPBkbDHB6VLbRf9CqaxGK%2Famazons3_actionsettings.png?alt=media&amp;token=1e1d8cb6-45df-440b-86a2-ad032eb18b5a" alt="The Action Settings section of the Add Action modal, with script inputs for the Copy File action" width="563"><figcaption></figcaption></figure></div>
{% 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 action

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

***

## Set Up an Upload File Action

The Upload File action writes a file in <code class="expression">space.vars.Kizen\_company\_name</code> to Amazon S3.

To set up an Upload File action:

{% 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.

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>Bucket</strong></td><td><code>String</code></td><td>The destination Amazon S3 bucket.</td><td>Yes</td></tr><tr><td><strong>Connection Secret Tag</strong></td><td><code>String</code></td><td>The name of the Amazon S3 environment from your integration secret on which to perform the operation.</td><td>Yes</td></tr><tr><td><strong>File</strong></td><td><code>UUID</code></td><td>The UUID of the <code class="expression">space.vars.Kizen_company_name</code> file to upload.</td><td>Yes</td></tr><tr><td><strong>Content Type</strong></td><td><code>String</code></td><td>The MIME type of the file to upload.</td><td>No</td></tr><tr><td><strong>Object Key</strong></td><td><code>String</code></td><td>The full object key of the <code class="expression">space.vars.Kizen_company_name</code> file on Amazon S3, including the path and the file name, like this: <code>loans/2026/statement.pdf</code>.</td><td>Yes</td></tr><tr><td><strong>Fail If Exists</strong></td><td>Boolean</td><td>Whether the upload should fail if the file to upload already exists at this location.</td><td>No</td></tr><tr><td><strong>SSE-KMS Key ID</strong></td><td><code>String</code></td><td>The KMS key ID or ARN to use to encrypt the file.</td><td>No</td></tr><tr><td><strong>Storage Class</strong></td><td><code>String</code></td><td>The API name of the uploaded file's storage class. The bucket's default storage class is the default value of this field.</td><td>No</td></tr></tbody></table>

{% hint style="info" %}
**Note:** See the [Amazon Simple Storage Service documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) for the API names of S3 storage classes.
{% 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.

The fields are as follows:

| Field               | Type     | Description                                                                                                                                                                 | Required? |
| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Destination Key** | `String` | The uploaded <code class="expression">space.vars.Kizen\_company\_name</code> file's Amazon S3 key.                                                                          | No        |
| **ETag**            | `String` | The uploaded <code class="expression">space.vars.Kizen\_company\_name</code> file's ETag.                                                                                   | No        |
| **Size**            | `Number` | The size of the uploaded <code class="expression">space.vars.Kizen\_company\_name</code> file in bytes.                                                                     | No        |
| **Version ID**      | `String` | The version ID of the uploaded <code class="expression">space.vars.Kizen\_company\_name</code> file. This field has a value only when the Amazon S3 bucket uses versioning. | No        |
| {% endstep %}       |          |                                                                                                                                                                             |           |
| {% endstepper %}    |          |                                                                                                                                                                             |           |

***

## Set Up a Get File Content Action

The Get File Content action creates a byte-for-byte copy of an Amazon S3 file in <code class="expression">space.vars.Kizen\_company\_name</code>. The file must be no larger than 250 MB, or the action fails.

To set up a Get File Content action:

{% 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.

The fields are as follows:

| Field                     | Type     | Description                                                                                                                       | Required? |
| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Bucket**                | `String` | The Amazon S3 bucket of the target file.                                                                                          | Yes       |
| **Connection Secret Tag** | `String` | The name of the Amazon S3 environment from your integration secret on which to perform the operation.                             | Yes       |
| **Object Key**            | `String` | The full object key of the target file on Amazon S3, including the path and the file name, like this: `loans/2026/statement.pdf`. | Yes       |
| **Version ID**            | `String` | The version ID of the target file on Amazon S3. Supply a value for this field only when the file's bucket uses versioning.        | No        |
| {% 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.

The fields are as follows:

| Field             | Type       | Description                                                                              | Required? |
| ----------------- | ---------- | ---------------------------------------------------------------------------------------- | --------- |
| **Content Type**  | `String`   | The source file's MIME type                                                              | No        |
| **ETag**          | `String`   | The source file's Etag                                                                   | No        |
| **File**          | `UUID`     | The UUID of the new <code class="expression">space.vars.Kizen\_company\_name</code> file | No        |
| **Last Modified** | `DateTime` | The date and time when the source object was last modified                               | No        |
| **Size**          | `Number`   | The size of the source file in bytes                                                     | No        |
| {% endstep %}     |            |                                                                                          |           |
| {% endstepper %}  |            |                                                                                          |           |

***

## Set Up a Get File Metadata Action

The Get File Metadata action returns the existence status, size, content type, last-modified time, and storage class of the specified Amazon S3 file without downloading the file.

To set up a Get File Metadata action:

{% 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.

The fields are as follows:

| Field                     | Type     | Description                                                                                                                       | Required? |
| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Bucket**                | `String` | The Amazon S3 bucket of the target file.                                                                                          | Yes       |
| **Connection Secret Tag** | `String` | The name of the Amazon S3 environment from your integration secret on which to perform the operation.                             | Yes       |
| **Object Key**            | `String` | The full object key of the target file on Amazon S3, including the path and the file name, like this: `loans/2026/statement.pdf`. | 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.

The fields are as follows:

| Field             | Type       | Description                                              | Required? |
| ----------------- | ---------- | -------------------------------------------------------- | --------- |
| **Content Type**  | `String`   | The target file's MIME type                              | No        |
| **ETag**          | `String`   | The target file's ETag                                   | No        |
| **Exists**        | `Boolean`  | Whether the target file exists                           | No        |
| **Last Modified** | `DateTime` | The date and time when the target file was last modified | No        |
| **Size**          | `Number`   | The size of the target file in bytes                     | No        |
| **Storage Class** | `String`   | The Amazon S3 storage class of the target file           | No        |

{% hint style="info" %}
**Note:** For descriptions of the S3 storage classes, see the [Amazon Simple Storage Service documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html).
{% endhint %}
{% endstep %}
{% endstepper %}

***

## Set Up a List Files Action

The List Files action returns a list of all the files in the specified folder. You can optionally filter the results by name or modified date and group the results by subfolder.

To set up a List Files action:

{% 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.

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>Bucket</strong></td><td><code>String</code></td><td>The Amazon S3 bucket of the target files.</td><td>Yes</td></tr><tr><td><strong>Connection Secret Tag</strong></td><td><code>String</code></td><td>The name of the Amazon S3 environment from your integration secret on which to perform the operation.</td><td>Yes</td></tr><tr><td><strong>Delimiter</strong></td><td><code>String</code></td><td>The character or characters by which to separate subfolders when the <strong>Group by Folder</strong> input is <code>yes</code>. Specify a value for this field only when the files in your bucket use a delimiter other than <code>/</code>.</td><td>No</td></tr><tr><td><strong>Fetch All Pages</strong></td><td><code>Boolean</code></td><td>Whether to return up to 100 pages of results as a single output (<code>yes</code>) or return one page per call (<code>no</code>).</td><td>No</td></tr><tr><td><strong>Folder</strong></td><td><code>String</code></td><td>The Amazon S3 prefix to target, like <code>loans/2026</code>.</td><td>No</td></tr><tr><td><strong>Group by Folder</strong></td><td><code>Boolean</code></td><td>Whether to group files that share a subfolder within the target folder.</td><td>No</td></tr><tr><td><strong>Max Results</strong></td><td><code>Number</code></td><td>The maximum number of files to return, from 1 to 1,000. The default value is <code>1000</code>.</td><td>No</td></tr><tr><td><strong>Modified After</strong></td><td><code>DateTime</code></td><td>A filter to return only those files modified after the specified date and time.</td><td>No</td></tr><tr><td><strong>Name Contains</strong></td><td><code>String</code></td><td>A filter to return only those files whose file names contain the specified string.</td><td>No</td></tr><tr><td><strong>Page Token</strong></td><td><code>String</code></td><td>The value of the Next Page Token field from the previous output of the List Files action. Pass this value to retrieve the next set of up to 100 files.</td><td>No</td></tr></tbody></table>

{% hint style="info" %}
**Note:** If you set the Fetch All Pages input to `yes` and there are more than 100 pages to return, you can get the remainder by including the value of the **Next Page Token** output field as the value of the **Page Token** input field in a subsequent List Files step.
{% 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.

The fields are as follows:

| Field               | Type     | Description                                                                                                                                                                        | Required? |
| ------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **File Count**      | `Number` | The number of listed files on the current page of results.                                                                                                                         | No        |
| **File Objects**    | `String` | A stringified JSON array of the listed files.                                                                                                                                      | No        |
| **Next Page Token** | `String` | A token that signifies there is at least one more page of up to 100 listed files to return. Pass this value in the **Page Token** input field of a subsequent List Files action.   | No        |
| **Sub-Folders**     | `String` | A stringified JSON array of the listed files on the current page of results grouped by subfolder. This field has a value only when you set the **Group by Folder** input to `yes`. | No        |

{% hint style="info" %}
**Note:** The List Files action fails if the value of the File Objects or Sub-Folders output field would be larger than 50,000 characters. For more information, see [Troubleshoot Amazon S3](/docs/integrations-and-apps/integrations/amazon-s3/troubleshoot-amazon-s3.md).
{% endhint %}
{% endstep %}
{% endstepper %}

***

## Set Up a Copy File Action

The Copy File action creates a copy of an Amazon S3 file elsewhere on Amazon S3. The destination can be a different bucket or even a different S3 environment.

{% hint style="info" %}
**Note:** When the source and destination have two different credentials, the file must be no larger than 250 MB, or the action fails. If the source and destination have the same credentials, this limit doesn't apply.
{% endhint %}

To set up a Copy File action:

{% 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.

The fields are as follows:

| Field                                 | Type     | Description                                                                                                                         | Required? |
| ------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Source Bucket**                     | `String` | The Amazon S3 bucket of the original file.                                                                                          | Yes       |
| **Destination Bucket**                | `String` | The Amazon S3 bucket for the copied file.                                                                                           | No        |
| **Source Connection Secret Tag**      | `String` | The name of the Amazon S3 environment from your integration secret where the original file resides.                                 | Yes       |
| **Destination Connection Secret Tag** | `String` | The name of the Amazon S3 environment from your integration secret in which to place the copied file.                               | Yes       |
| **Source Object Key**                 | `String` | The full object key of the original file on Amazon S3, including the path and the file name, like this: `loans/2026/statement.pdf`. | Yes       |
| **Destination Object Key**            | `String` | The full object key of the copied file on Amazon S3, including the path and the file name, like this: `loans/2026/statement.pdf`.   | 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.

The fields are as follows:

| Field               | Type       | Description                                                | Required? |
| ------------------- | ---------- | ---------------------------------------------------------- | --------- |
| **Destination Key** | String     | The Amazon S3 object key of the copied file                | No        |
| **ETag**            | `String`   | The original file's ETag                                   | No        |
| **Last Modified**   | `DateTime` | The date and time when the original file was last modified | No        |
| {% endstep %}       |            |                                                            |           |
| {% endstepper %}    |            |                                                            |           |

***

## Set Up a Generate Presigned URL Action

The Generate Presigned URL action creates a temporary presigned upload or download URL for moving files to and from Amazon S3.

To set up a Generate Presigned URL action:

{% 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.

The fields are as follows:

| Field                     | Type     | Description                                                                                                                                                                                                                                                                                          | Required? |
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| **Bucket**                | `String` | The Amazon S3 bucket to use for the upload or download.                                                                                                                                                                                                                                              | Yes       |
| **Connection Secret Tag** | `String` | The name of the target Amazon S3 environment from your integration secret.                                                                                                                                                                                                                           | Yes       |
| **Expires In**            | `Number` | The lifespan of the link in seconds. The maximum value is `604800`, the same as 7 days. Exceeding the maximum causes the step to fail.                                                                                                                                                               | Yes       |
| **Object Key**            | `String` | The full object key of the file, including the path and the file name, like this: `loans/2026/statement.pdf`. For an upload operation, the integration uploads the file to this location under this file name. For a download operation, this is the location and file name of the file to download. | Yes       |
| **Operation**             | `String` | The operation to perform. For an upload link, set the value to `put`. For a download link, set the value to `get`.                                                                                                                                                                                   | 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.

The fields are as follows:

| Field            | Type       | Description                                      | Required? |
| ---------------- | ---------- | ------------------------------------------------ | --------- |
| **Expires At**   | `DateTime` | The date and time when the presigned URL expires | No        |
| **URL**          | `String`   | The presigned upload or download URL             | No        |
| {% endstep %}    |            |                                                  |           |
| {% endstepper %} |            |                                                  |           |

***

## What's Next

Continue to [Troubleshoot Amazon S3](/docs/integrations-and-apps/integrations/amazon-s3/troubleshoot-amazon-s3.md) to find solutions to common issues with the Amazon S3 integration.

<details>

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

* [Amazon S3](/docs/integrations-and-apps/integrations/amazon-s3.md)
* [Set Up Amazon S3 in Kizen](/docs/integrations-and-apps/integrations/amazon-s3/set-up-amazon-s3-in-kizen.md)
* [Troubleshoot Amazon S3](/docs/integrations-and-apps/integrations/amazon-s3/troubleshoot-amazon-s3.md)

</details>

***

*Amazon Web Services, AWS, Amazon Simple Storage Service, and Amazon S3 are trademarks of Amazon.com, Inc. or its affiliates. Kizen's Amazon S3 integration is not affiliated with, sponsored by, or endorsed by Amazon.com, 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-apps/integrations/amazon-s3/work-with-amazon-s3-files-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.
