Overview
This node integrates with Amazon QLDB (Quantum Ledger Database) to perform various database operations on a specified ledger and table. It allows users to select, insert, update, upsert, or run direct queries against the ledger's tables. The node is useful for scenarios where you need to interact programmatically with an immutable and cryptographically verifiable ledger database, such as financial transaction tracking, supply chain auditing, or any application requiring an authoritative data source.
For example, you can use this node to:
- Select records from a ledger table based on specific filter criteria.
- Insert new documents into a ledger table.
- Update existing documents matching certain conditions.
- Upsert documents, i.e., create new or update existing ones depending on whether they exist.
- Run custom QLDB SQL queries directly.
Properties
| Name | Meaning |
|---|---|
| Ledger | Name of the ledger to connect to in Amazon QLDB. |
| Table | Name of the table (also called a database) within the ledger to operate on. |
| Where | JSON object representing the filter clause used for selecting, updating, or upserting data. |
| Flatten Results | Boolean flag indicating whether to unpack document updates; may change the number of outputs. |
Output
The node outputs an array of JSON objects under the json field. Each object corresponds to the result of the executed operation and contains the queried or affected records from the ledger table.
- For select operations, it returns the filtered records matching the "where" clause.
- For insert, update, and upsert operations, it returns the resulting documents after the operation.
- If "Flatten Results" is enabled, the output array is flattened so that each record is a separate item in the output.
- The node does not output binary data.
Dependencies
- Requires valid AWS credentials with permissions to access Amazon QLDB.
- Needs configuration of AWS region and API keys (access key ID and secret access key).
- Uses an internal QLDB service client to execute commands via AWS SDK.
- No additional external dependencies beyond AWS SDK and n8n credential setup.
Troubleshooting
- Invalid Credentials or Permissions: Errors related to authentication or authorization usually mean the provided AWS credentials lack necessary permissions or are incorrect. Verify the API key and secret, and ensure the IAM role/user has QLDB access.
- Malformed JSON in "Where" or "Document": The node expects valid JSON strings for filtering and document content. Invalid JSON will cause parsing errors. Use proper JSON formatting.
- Empty or Incorrect Ledger/Table Names: Ensure the ledger and table names exactly match those configured in your QLDB instance.
- Query Syntax Errors: For direct queries, invalid QLDB SQL syntax will cause failures. Validate queries before running.
- Flatten Results Side Effects: Enabling flattening may produce more or fewer output items than input items, which might affect downstream nodes expecting one-to-one correspondence.
