Amazon DynamoDB Block
Read, write, and query data in Amazon DynamoDB
The Amazon DynamoDB block integrates AWS DynamoDB into your workflows. Use it to get, put, update, and delete items, run key-based queries and full-table scans, and perform batch writes — all from a single configurable block.
Overview
| Property | Value |
|---|---|
| Type | dynamodb |
| Category | tools |
| Color | #4D27A8 |
When to Use
- Look up a single item by its primary key during a workflow run
- Persist workflow results by putting or updating items in a table
- Delete items as part of cleanup or state-management logic
- Query a table by partition/sort key using a key condition expression
- Scan a table with an optional filter to find matching records
- Write or remove many items at once with a batch write operation
Configuration
Operation
Required dropdown. Selects which DynamoDB action to run. The chosen operation determines which additional fields are shown.
| Label | ID |
|---|---|
| Get Item | dynamodb_get_item |
| Put Item | dynamodb_put_item |
| Update Item | dynamodb_update_item |
| Delete Item | dynamodb_delete_item |
| Query | dynamodb_query |
| Scan | dynamodb_scan |
| Batch Write | dynamodb_batch_write |
AWS Region
Required. The AWS region your table lives in (e.g. us-east-1).
Access Key ID
Required. Your AWS access key ID, stored as a secret (password field).
Secret Access Key
Required. Your AWS secret access key, stored as a secret (password field).
Table Name
Required. The name of the DynamoDB table to operate on.
Primary Key (JSON) — key
A JSON object containing the item's primary (and optional sort) key, e.g. {"pk": "value", "sk": "sort_value"}. Shown when the operation is Get Item, Update Item, or Delete Item.
Item (JSON) — item
A JSON object representing the full item to write, e.g. {"pk": "value", "sk": "sort", "data": "content"}. Shown when the operation is Put Item.
Key Condition — keyConditionExpression
A DynamoDB key condition expression string (e.g. pk = :pk). Required when the operation is Query.
Filter Expression — filterExpression
An optional filter expression applied after the read, e.g. attribute = :val. Shown when the operation is Scan or Query.
Inputs & Outputs
Inputs (all subBlock ids map directly to the inputs map):
operation(string) — Operation to perform (one of the operation IDs above)awsRegion(string) — AWS regionawsAccessKeyId(string) — AWS access key IDawsSecretAccessKey(string) — AWS secret access keytableName(string) — Table namekey(json) — Primary key (used by Get Item, Update Item, Delete Item)item(json) — Item data (used by Put Item)keyConditionExpression(string) — Key condition expression (used by Query)filterExpression(string) — Filter expression (used by Query and Scan)
Outputs (available on the block's result):
item(json) — Retrieved item (Get Item)items(json) — Array of results from Query or Scancount(number) — Number of items returned by Query or Scan
Tools
Each operation resolves to a dedicated tool registered in tools/registry.ts:
- DynamoDB Get Item (
dynamodb_get_item) — Fetches a single item by its primary key. Returnsitem. - DynamoDB Put Item (
dynamodb_put_item) — Inserts or replaces an item. Returnssuccess(boolean). - DynamoDB Update Item (
dynamodb_update_item) — Updates attributes of an existing item using an update expression and expression attribute values. Returnsattributes(the updated item attributes). - DynamoDB Delete Item (
dynamodb_delete_item) — Deletes an item by its primary key. Returnssuccess(boolean). - DynamoDB Query (
dynamodb_query) — Queries a table using a key condition expression, with optional filter, index name, and limit. Returnsitems,count, andlastEvaluatedKey(for pagination). - DynamoDB Scan (
dynamodb_scan) — Scans all items in a table with an optional filter expression and limit. Returnsitems,count, andlastEvaluatedKey. - DynamoDB Batch Write (
dynamodb_batch_write) — Executes multiple put and delete requests in a single call. AcceptsrequestItemsas a JSON map of table → array ofPutRequest/DeleteRequest. ReturnsunprocessedItems(empty if all succeeded).
YAML Example
dynamodb_1:
type: dynamodb
name: "Amazon DynamoDB"
inputs:
operation: "dynamodb_get_item"
awsRegion: "us-east-1"
awsAccessKeyId: "{{AWS_ACCESS_KEY_ID}}"
awsSecretAccessKey: "{{AWS_SECRET_ACCESS_KEY}}"
tableName: "MyTable"
key: '{"pk": "{{start.input}}"}'
connections:
outgoing:
- target: next-block-id