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 execute commands such as selecting records, inserting new records, updating existing ones, upserting (create or update), running direct custom queries, or retrieving all records from a table.
Common scenarios where this node is beneficial include:
- Managing immutable ledger data for financial transactions or audit trails.
- Querying and manipulating data in a cryptographically verifiable ledger.
- Automating workflows that require interaction with QLDB tables, such as inserting new entries or updating existing ones based on business logic.
- Running custom queries to extract specific information from the ledger.
Practical examples:
- Insert a new transaction record into a ledger table.
- Update user details in a ledger after verifying certain conditions.
- Run a direct query to fetch all records matching a complex filter.
- Retrieve all records from a ledger table for reporting purposes.
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. |
| Flatten Results | Boolean flag indicating whether to unpack document updates; may change the number of outputs. |
Additional operation-specific properties (selected by the "Operation" parameter):
| Name | Meaning |
|---|---|
| Operation | The action to perform: All, Create (insert), Create or Update (upsert), Direct Query, Select, Update. |
| Direct Query | A custom QLDB SQL query string, used only when Operation is "Direct Query". |
| Where | JSON object representing the WHERE clause filter, used for Select, Update, and Upsert operations. |
| Document | JSON object representing the document contents to insert, update, or upsert. |
Output
The node outputs an array of JSON objects representing the results of the executed QLDB operations. Each output item corresponds to one input item processed.
- For select, all, and direct query operations, the output contains the retrieved records.
- For insert, update, and upsert operations, the output contains the affected documents after the operation.
- If "Flatten Results" is enabled, the output array is flattened so that each document update is returned as a separate output item, which may result in more or fewer outputs than inputs.
The output JSON structure reflects the documents stored in QLDB tables, typically as key-value pairs corresponding to the ledger's schema.
The node does not output binary data.
Dependencies
- Requires valid AWS credentials with permissions to access Amazon QLDB ledgers and tables.
- Needs configuration of AWS region and authentication via an API key credential or similar secure method.
- Relies on the n8n environment having network access to AWS QLDB endpoints.
Troubleshooting
- Invalid Credentials: Errors related to authentication usually indicate missing or incorrect AWS credentials. Ensure the API key or authentication token is correctly configured.
- Malformed JSON Input: The "Where" and "Document" fields expect valid JSON strings. Invalid JSON will cause parsing errors. Validate JSON syntax before use.
- Query Syntax Errors: Custom queries must follow QLDB SQL syntax. Incorrect queries will result in execution errors.
- Empty or Missing Parameters: Omitting required parameters like ledger name or table name will cause failures. Always provide these values.
- Flatten Results Side Effects: Enabling flattening can produce unexpected numbers of output items. Use carefully depending on downstream workflow expectations.
