> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/amazon-dynamodb.md).

# Amazon DynamoDB

Connect to Amazon DynamoDB to save, look up, and query records by key, update fields, run PartiQL statements, and discover tables and their key schema.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector       | Authentication |
| --------------- | -------------- |
| Amazon DynamoDB | Credentials    |

#### Amazon DynamoDB

Connect to Amazon DynamoDB with an AWS access key to save, look up, and query records, run PartiQL statements, and discover tables in one AWS region.

**Set up in Amazon DynamoDB**

1. Prepare the Amazon DynamoDB account or service that the workflow will access. Grant access to the required resources and operations.
2. **AWS Access Key ID:** Create an IAM user or role scoped to only the DynamoDB permissions this workflow needs (e.g. dynamodb:GetItem and dynamodb:Query on one table's ARN) rather than reusing a broad administrator credential.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Amazon DynamoDB**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field         | Required | What to enter                                                                                                                                                                                                                                                                                                         |
| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AWS Region            | Yes      | The AWS region your DynamoDB tables live in, e.g. 'us-east-1'. Every table name used by these actions is looked up in this region only. [Provider instructions](https://docs.aws.amazon.com/general/latest/gr/ddb.html).                                                                                              |
| AWS Access Key ID     | Yes      | Create an IAM user or role scoped to only the DynamoDB permissions this workflow needs (e.g. dynamodb:GetItem and dynamodb:Query on one table's ARN) rather than reusing a broad administrator credential. [Provider instructions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html). |
| AWS Secret Access Key | Yes      | The secret key paired with the Access Key ID above. [Provider instructions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).                                                                                                                                                        |

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Amazon DynamoDB** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Save Item

Save a record to a DynamoDB table, optionally refusing to overwrite an existing one.

**Inputs**

| Field                            | Type            | Required | Description                                                                   |
| -------------------------------- | --------------- | -------- | ----------------------------------------------------------------------------- |
| Table                            | select (string) | Yes      | The table to save the record in. Options load from the selected connection.   |
| Record                           | textarea        | Yes      | The record to save, written as JSON. Must include the table's key fields.     |
| Do not overwrite existing record | boolean         | No       | Fail instead of replacing a record that already has this key. Default: false. |

**Outputs**

| Field        | Type   | Description                                 |
| ------------ | ------ | ------------------------------------------- |
| Saved Record | object | The record that was written, as plain JSON. |

#### Get Item

Look up a single record by its key.

**Inputs**

| Field                    | Type            | Required | Description                                                                       |
| ------------------------ | --------------- | -------- | --------------------------------------------------------------------------------- |
| Table                    | select (string) | Yes      | The table to read from. Options load from the selected connection.                |
| Record Key               | textarea        | Yes      | The key that identifies the record, as JSON, e.g. {"orderId": "ord\_1042"}.       |
| Fields To Return         | string          | No       | Only return these fields, comma separated. Leave empty for the whole record.      |
| Strongly consistent read | boolean         | No       | Guarantee you read the very latest write, at twice the read cost. Default: false. |

**Outputs**

| Field  | Type    | Description                                                  |
| ------ | ------- | ------------------------------------------------------------ |
| Record | object  | The record found, as plain JSON. Empty when nothing matched. |
| Found  | boolean | Whether a record with that key exists.                       |

#### Query Items

Find the records that share a key value, such as every order for one customer.

**Inputs**

| Field                    | Type            | Required | Description                                                                                                                                                                                                    |
| ------------------------ | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Table                    | select (string) | Yes      | The table to search. Options load from the selected connection.                                                                                                                                                |
| Key Field                | select (string) | Yes      | The field the records are grouped by, for example customerId. Options load from the selected connection.                                                                                                       |
| Key Value                | string          | Yes      | The value to match, for example the customer id whose orders you want.                                                                                                                                         |
| Index                    | select (string) | No       | Search a secondary index instead of the table itself. Options load from the selected connection.                                                                                                               |
| Sort Field               | select (string) | No       | Narrow the results by the table's sort field, such as a date. Options load from the selected connection.                                                                                                       |
| Sort Field Condition     | select (string) | No       | How to compare the sort field: equals, before, after, starts with, or a range. Available values: Equals, Less than, Less than or equal, Greater than, Greater than or equal, Begins with, Between (inclusive). |
| Sort Field Value         | string          | No       | The value to compare the sort field against.                                                                                                                                                                   |
| Sort Field Range End     | string          | No       | The end of the range, when using the between condition.                                                                                                                                                        |
| Fields To Return         | string          | No       | Only return these fields, comma separated. Leave empty for whole records.                                                                                                                                      |
| Newest first             | boolean         | No       | Return the results in reverse sort-field order, which is usually newest first. Default: false.                                                                                                                 |
| Strongly consistent read | boolean         | No       | Guarantee you read the very latest writes, at twice the read cost. Default: false.                                                                                                                             |
| Maximum Records          | integer         | No       | How many records to return at most. Minimum: 1. Default: 100.                                                                                                                                                  |
| Continue From            | string          | No       | Continue a previous query from where it stopped. Paste the cursor from the earlier run.                                                                                                                        |

**Outputs**

| Field          | Type        | Description                                                                            |
| -------------- | ----------- | -------------------------------------------------------------------------------------- |
| Records        | dict\_array | The matching records, as plain JSON.                                                   |
| Record Count   | integer     | How many records were returned.                                                        |
| Next Cursor    | string      | Pass this back into a later run to fetch the next batch. Empty when there are no more. |
| More Available | boolean     | Whether more records are waiting beyond this batch.                                    |

#### Update Item

Change specific fields on a record without rewriting the whole thing.

**Inputs**

| Field                          | Type            | Required | Description                                                                                 |
| ------------------------------ | --------------- | -------- | ------------------------------------------------------------------------------------------- |
| Table                          | select (string) | Yes      | The table holding the record. Options load from the selected connection.                    |
| Record Key                     | textarea        | Yes      | The key that identifies the record to change, as JSON.                                      |
| Fields To Set                  | textarea        | No       | The fields to write, as JSON. Existing values are overwritten; other fields are left alone. |
| Fields To Delete               | string          | No       | Fields to delete from the record, comma separated.                                          |
| Only update an existing record | boolean         | No       | Fail instead of creating a new record when the key does not exist. Default: false.          |

**Outputs**

| Field  | Type   | Description                                       |
| ------ | ------ | ------------------------------------------------- |
| Record | object | The whole record after the change, as plain JSON. |

#### Run PartiQL Statement

Run a SQL-like PartiQL statement against your tables. Can change or delete data.

**Inputs**

| Field                    | Type     | Required | Description                                                                                           |
| ------------------------ | -------- | -------- | ----------------------------------------------------------------------------------------------------- |
| PartiQL Statement        | textarea | Yes      | The PartiQL statement to run. Statements that insert, update, or delete change your data permanently. |
| Statement Values         | textarea | No       | The values for the ? placeholders, as a JSON array in order.                                          |
| Strongly consistent read | boolean  | No       | Guarantee you read the very latest writes, at twice the read cost. Default: false.                    |
| Maximum Records          | integer  | No       | How many records to return at most. Minimum: 1. Default: 100.                                         |
| Continue From            | string   | No       | Continue a previous statement from where it stopped. Paste the cursor from the earlier run.           |

**Outputs**

| Field          | Type        | Description                                                                            |
| -------------- | ----------- | -------------------------------------------------------------------------------------- |
| Records        | dict\_array | The records the statement returned, as plain JSON. Empty for a write statement.        |
| Record Count   | integer     | How many records were returned.                                                        |
| Next Cursor    | string      | Pass this back into a later run to fetch the next batch. Empty when there are no more. |
| More Available | boolean     | Whether more records are waiting beyond this batch.                                    |

#### List Tables

List the DynamoDB tables available in this account and region.

**Inputs**

| Field          | Type    | Required | Description                                                       |
| -------------- | ------- | -------- | ----------------------------------------------------------------- |
| Maximum Tables | integer | No       | How many table names to return at most. Minimum: 1. Default: 100. |
| Continue From  | string  | No       | Continue a previous listing from where it stopped.                |

**Outputs**

| Field          | Type          | Description                                                                            |
| -------------- | ------------- | -------------------------------------------------------------------------------------- |
| Table Names    | string\_array | The table names found, as a JSON array.                                                |
| Table Count    | integer       | How many table names were returned.                                                    |
| Next Cursor    | string        | Pass this back into a later run to fetch the next batch. Empty when there are no more. |
| More Available | boolean       | Whether more table names are waiting beyond this batch.                                |

#### Describe Table

Show a table's key fields and indexes, so you know how to read and write it.

**Inputs**

| Field | Type            | Required | Description                                                      |
| ----- | --------------- | -------- | ---------------------------------------------------------------- |
| Table | select (string) | Yes      | The table to inspect. Options load from the selected connection. |

**Outputs**

| Field               | Type          | Description                                                                            |
| ------------------- | ------------- | -------------------------------------------------------------------------------------- |
| Table Name          | string        | The table's name.                                                                      |
| Status              | string        | Whether the table is active and ready to use.                                          |
| Approximate Records | integer       | Roughly how many records the table holds. DynamoDB updates this about every six hours. |
| Partition Key Field | string        | The field that groups records, required in every key.                                  |
| Partition Key Type  | string        | The partition key's data type: text, number, or binary.                                |
| Sort Key Field      | string        | The field records are ordered by within a partition. Empty when the table has none.    |
| Sort Key Type       | string        | The sort key's data type: text, number, or binary. Empty when there is no sort key.    |
| Indexes             | object\_array | The table's secondary indexes and the fields each one is keyed on.                     |

### Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# 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://docs.stackai.com/integrations/catalog/amazon-dynamodb.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.
