Skip to main content

AWS DynamoDB ExecModule

Overview

AwsDynamoDbModule connects ValkyrAI workflows to Amazon DynamoDB through the bundled AWS SDK v2 client. It covers n8n's core DynamoDB item operations while adding table discovery, table metadata, native DynamoDB attribute types, bounded pagination, verified IntegrationAccount credentials, annotation-backed Workflow Studio discovery, and conservative replay behavior for writes.

The connector implements eight operations:

  • discovery: list_tables, describe_table
  • reads: get_item, query, scan
  • mutations: put_item, update_item, delete_item

Table lifecycle, batch and transactional APIs, streams, TTL management, PartiQL, DAX, import/export, and backup operations are intentionally outside this first governed surface.

Usage

  1. Create a dedicated AWS IAM principal scoped to the exact DynamoDB tables and indexes the workflow needs.
  2. Store its access key ID and secret access key in an AWS IntegrationAccount, verify the account, and keep it in READY status.
  3. Add AwsDynamoDbModule to a workflow and bind the account through ExecModuleConfig.authConfig.integrationAccount.
  4. Set operation, region, tableName, and the operation-specific key, item, expression, or pagination fields.
  5. Preserve returned keys and AWS request IDs. For any ambiguous mutation response, inspect current table state before replaying the write.

Never place AWS credentials in mapped input, item attributes, logs, or examples. Credential-like input fields are rejected before provider access.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the eight documented operations.
regionstringEvery executionNoneAWS region syntax such as us-west-2; custom endpoints are not accepted.
tableNamestringAll except list_tablesNoneDynamoDB table-name syntax, 3-255 characters.
keyobjectget_item, update_item, delete_itemNoneOne or two non-empty string, number, or $binary attributes.
itemobjectput_itemNoneNon-empty natural JSON item, bounded to DynamoDB's 400 KiB item limit.
indexNamestringOptional query or scanNoneLocal or global secondary index name.
keyConditionExpressionstringqueryNoneDynamoDB key condition, at most 4,096 characters.
filterExpressionstringOptional query or scanNoneDynamoDB filter expression, at most 4,096 characters.
updateExpressionstringupdate_itemNoneDynamoDB update expression, at most 4,096 characters.
conditionExpressionstringOptional mutationNoneConditional-write guard, at most 4,096 characters.
projectionExpressionstringOptional readNoneAttribute projection, at most 4,096 characters.
expressionAttributeNamesobjectOptional expression{}At most 255 #alias entries.
expressionAttributeValuesobjectOptional expression{}At most 255 :value entries using the item value notation below.
exclusiveStartKeyobjectOptional query or scan resumeNoneOpaque nextKey from a prior response.
nextTokenstringOptional list_tables resumeNoneOpaque AWS table-name continuation.
limitintegerList, query, or scan1001-10,000 returned tables or items.
pageSizeintegerQuery or scan1001-1,000 provider evaluations per request.
returnAllbooleanList, query, or scanfalseFollow pages until exhaustion, limit, or the 100-page guard.
consistentReadbooleanget_item, query, or scanfalseRequests a strong read where DynamoDB supports it.
scanIndexForwardbooleanquerytrueAscending sort-key order when true.
returnValuesstringMutationNONEPut/delete: NONE or ALL_OLD; update also supports UPDATED_OLD, ALL_NEW, and UPDATED_NEW.
confirmDeletebooleandelete_itemfalseMust be explicitly true before deletion.

Natural JSON strings, booleans, numbers, nulls, arrays, and objects map to DynamoDB S, BOOL, N, NULL, L, and M. Use a single-key tagged object for types JSON cannot express directly:

{
"binary": {"$binary": "AQI="},
"roles": {"$stringSet": ["planner", "worker"]},
"scores": {"$numberSet": [1, 2.5]},
"blobs": {"$binarySet": ["AQ==", "Ag=="]}
}

Sets must be non-empty and contain unique values. Numbers are normalized without precision loss and must fit DynamoDB's 38-digit numeric range.

Outputs

Every execution returns stable status, operation, and attempts fields.

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls, including safe read retries and pages.
dataobjectItem, table, or mutation successNormalized result and optional returned attributes.
itemsarrayList, query, or scan successBounded table or decoded item results.
countintegerList, query, or scan successNumber of returned rows.
scannedCountintegerQuery or scan successProvider-evaluated row count across fetched pages.
hasMorebooleanPaginated read successWhether another provider page exists.
nextTokenstringAnother table-list page existsOpaque continuation for list_tables.
nextKeyobjectAnother query/scan page existsDecoded opaque key for exclusiveStartKey.
requestIdstringAWS supplies oneBounded provider reference for reconciliation and support.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

Items may contain confidential application state. Do not log or forward keys, attributes, continuation keys, or returned images to unapproved destinations.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

FieldRequirement
ProviderAmazon Web Services / DynamoDB
statusMust be READY.
verifiedMust be true.
apiKey SecureFieldAWS access key ID.
password SecureFieldAWS secret access key.

Grant only the actions used by the workflow:

  • dynamodb:ListTables for list_tables
  • dynamodb:DescribeTable for describe_table
  • dynamodb:GetItem for get_item
  • dynamodb:Query for query
  • dynamodb:Scan for scan
  • dynamodb:PutItem for put_item
  • dynamodb:UpdateItem for update_item
  • dynamodb:DeleteItem for delete_item

Restrict item and query actions to exact table and index ARNs. ListTables is the only operation here that AWS does not resource-scope. The current connector supports a long-lived access-key pair. Temporary session credentials, role assumption, cross-account role chaining, and caller-supplied credentials are deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, region, table, expressions, and pagination belong in module parameters or mapped input; read retries use the normalized retry policy.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-dynamodb-production"
},
"retryPolicy": {
"maxAttempts": 3
},
"payloadConfig": {
"parameters": "{\"operation\":\"query\",\"region\":\"us-west-2\",\"tableName\":\"workflow-state\",\"keyConditionExpression\":\"tenantId = :tenant\"}"
}
}

The relationship value is illustrative. Persisted workflows bind the generated IntegrationAccount relationship, never plaintext credentials.

Operations

OperationProvider behaviorSide effect and retry behavior
list_tablesLists region tables using opaque table-name pagination.Read-only; transient failures retry within the configured bound.
describe_tableReads key schema, attribute definitions, status, size, indexes, and protection state.Read-only; transient failures retry. Counts and sizes are approximate.
get_itemReads one exact primary key with optional projection and strong consistency.Read-only; transient failures retry.
queryEvaluates one table or index key condition with optional filter and projection.Read-only; transient failures retry; pagination is bounded.
scanEvaluates bounded table or index pages with optional filter and projection.Read-only but potentially capacity-intensive; transient failures retry.
put_itemWrites one complete item with an optional condition.External write; exactly one provider attempt.
update_itemApplies one update expression with an optional condition.External write; exactly one provider attempt.
delete_itemDeletes one exact primary key with an optional condition.Destructive; requires confirmDelete=true; exactly one provider attempt.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing or invalid table, key, item, expression, native type, bound, or delete confirmation.NoCorrect the named input; no provider request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_ERRORAccount missing, unverified, not READY, or missing key material.NoRepair and bind the AWS account.
AWS_DYNAMODB_HTTP_400Invalid expression, key mismatch, failed condition, or exceeded capacity.Provider-dependentInspect the current item and request ID before deciding whether to retry.
AWS_DYNAMODB_HTTP_403IAM denies the action.NoGrant only the missing action on the intended table or index.
AWS_DYNAMODB_HTTP_404Table or index is absent or invisible.NoVerify region, account, and exact resource name.
AWS_DYNAMODB_HTTP_429 / 503Transient provider pressure.Yes for reads onlyReads can retry; reconcile all mutations before replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Yes for reads onlyTreat mutation outcomes as ambiguous and inspect current item state.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic replayPreserve table, key, condition, and request ID for reconciliation.

Provider exception text is not copied into output, preventing credential echoes and unbounded error payloads.

Example

Conditionally advance durable workflow state:

{
"operation": "update_item",
"region": "us-west-2",
"tableName": "workflow-state",
"key": {"jobId": "job-123"},
"updateExpression": "SET #state = :next, #version = :newVersion",
"conditionExpression": "#version = :expectedVersion",
"expressionAttributeNames": {
"#state": "state",
"#version": "version"
},
"expressionAttributeValues": {
":next": "ready",
":newVersion": 3,
":expectedVersion": 2
},
"returnValues": "ALL_NEW"
}

Expected result shape:

{
"status": "success",
"operation": "update_item",
"attempts": 1,
"requestId": "aws-request-reference",
"data": {
"tableName": "workflow-state",
"updated": true,
"attributes": {
"jobId": "job-123",
"state": "ready",
"version": 3
}
}
}

Notes

  • Pagination: list_tables preserves AWS table-name tokens. query and scan expose the last evaluated key as nextKey. returnAll=true stops at limit, resource exhaustion, or 100 provider pages.
  • Capacity: pageSize bounds items evaluated per provider request; filters run after DynamoDB reads items and therefore do not reduce consumed read capacity. Prefer query to scan, use narrow projections, and size provisioned/on-demand capacity independently.
  • API limits: items are bounded at 400 KiB, result accumulation at 10,000 items, expressions at 4,096 characters, maps at 32 nested levels, and expression maps at 255 entries.
  • Consistency: strongly consistent reads are not supported on global secondary indexes. The module forwards the requested mode and surfaces the provider rejection safely.
  • Retry policy: HTTP 408, 429, 500, 502, 503, and 504 plus network failures can retry only for reads, bounded by RetryPolicy.maxAttempts from 1 through 5. AWS SDK retries are disabled so module accounting and single-attempt writes remain deterministic.
  • Idempotency: reads are safe to retry. Mutations are single-attempt because network failures can leave an ambiguous outcome. Use conditionExpression with a version or absence check, then read current state before replaying.
  • Destructive behavior: delete_item permanently removes the item identified by the exact primary key and requires explicit confirmation. Table deletion is not exposed.
  • Data handling: item keys, values, returned images, and continuation keys are confidential. The module never logs request or response bodies.
  • Provider verification boundary: deterministic tests cover validation, fixed routing, account isolation, native types, request mapping, pagination, read retries, mutation replay boundaries, normalization, redaction, registration, and delete confirmation. Live AWS behavior remains unverified until an authorized DynamoDB credential and reviewed test table are supplied.
  • Functional reference: n8n's AWS DynamoDB node centers on get, get-all, upsert, and delete item workflows, including query-versus-scan selection and expressions. ValkyrAI adds discovery, table metadata, explicit put versus update semantics, native type preservation, verified account enforcement, bounded outputs, and conservative single-attempt writes.
  • Runtime boundary: merged source and published documentation do not update the deployed Workflow Studio catalog until a ValkyrAI backend release exposes AwsDynamoDbModule through /v1/modules/metadata.