@gravityai-dev/aws-dynamodb
v1.1.0
Published
AWS DynamoDB integration for Gravity workflow system - includes put, fetch, and service operations
Maintainers
Readme
@gravityai-dev/aws-dynamodb
AWS DynamoDB integration plugin for the Gravity workflow system. Provides nodes for database operations including put, fetch, and service operations.
Features
- DynamoDB: Put records to DynamoDB tables with conditional expressions
- DynamoDBFetch: Fetch records by primary/sort key with null handling
- DynamoDBService: Service node providing NoSQL operations for other nodes
- Full AWS SDK v3 integration with document client
- Client caching for performance optimization
- Comprehensive error handling and logging
Installation
npm install @gravityai-dev/aws-dynamodbNodes
DynamoDB
Uploads a record to an AWS DynamoDB table with optional conditional expressions.
Inputs:
signal: Record data to upload (can override config record)
Outputs:
success: Whether the upload was successfulitemId: ID of the uploaded item (if available)
Configuration:
tableName: Name of the DynamoDB tablerecord: JS Code to transform dataconditionExpression: Optional condition for the put operationexpressionAttributeNames: Substitution tokens for attribute namesexpressionAttributeValues: Values for expression substitution
DynamoDBFetch
Fetches a record from AWS DynamoDB table by key, returns null if not found.
Inputs:
signal: Input object containing key values
Outputs:
output: The fetched record or null if not foundfound: Whether the record was found
Configuration:
tableName: The name of the DynamoDB tableprimaryKey: The field name for the primary key (partition key)sortKey: The field name for the sort key (optional)
DynamoDBService
Provides DynamoDB operations as a service for other nodes. Marked as a service node.
Service Connectors:
nosqlService: Provides NoSQL database operations- Methods: put, get, query, update, delete, batchGet, batchWrite
Configuration:
region: AWS region for DynamoDBdefaultTable: Default table name (can be overridden per operation)
Credentials
Requires AWS credentials with the following fields:
accessKeyId: Your AWS access key IDsecretAccessKey: Your AWS secret access keyregion: AWS region (e.g., us-east-1)
Usage Example
- Add DynamoDB node to put records to a table
- Use DynamoDBFetch to retrieve records by key
- Connect DynamoDBService for advanced operations
- Configure conditional expressions for data integrity
Development
# Install dependencies
npm install
# Build the package
npm run build
# Run tests
npm testLicense
MIT
