Overview
This node allows you to store and retrieve key/value data in a local SQLite database file. It is useful for scenarios where you want to persist small amounts of structured data between workflow executions without relying on external databases or services.
Typical use cases include:
- Caching API responses or intermediate results.
- Storing configuration or state information locally.
- Sharing data between different parts of a workflow or across multiple workflow runs.
For example, you can store user preferences keyed by user ID, then later retrieve those preferences by the same key.
Properties
| Name | Meaning |
|---|---|
| Database File | Path to the SQLite file (relative or absolute) where data will be stored. |
| Table | Name of the table in the SQLite database to store data. Must start with a letter/underscore and contain only letters, digits, and underscores. Default is kv_store. |
| Key Source | How to determine the key for storing/retrieving data: either from a field in the input JSON or a fixed value. Options: Field, Fixed Value. |
| Key Field Name | When Key Source is Field, this is the name of the field in the input JSON that contains the key. Default is key. |
| Key Value | When Key Source is Fixed Value, this is the fixed key string to use (supports expressions). |
| Value Field Name | The field name in the item JSON that contains (for storing) or will receive (for retrieving) the value. Default is value. |
| Value Source | For the Store operation only: how to determine the value to store — from a field in the input JSON or a fixed value. Options: Field, Fixed Value. |
| Value | For the Store operation only and when Value Source is Fixed Value: the fixed string value to store (can use expressions to build JSON). |
Output
The node outputs an array of items with JSON data reflecting the operation result:
For the Store operation:
- Each item's JSON will have the original fields plus:
_stored: booleantrueindicating the value was successfully stored._updatedAt: timestamp (Unix epoch seconds) when the value was stored.
- Each item's JSON will have the original fields plus:
For the Get operation:
- Each item's JSON will have the original fields plus:
- The specified
Value Field Namecontaining the retrieved value (parsed from JSON if possible). _found: boolean indicating whether the key was found (true) or not (false).
- The specified
- Each item's JSON will have the original fields plus:
If an error occurs per item and "Continue On Fail" is enabled, the output item will include an error field describing the issue.
No binary data output is produced by this node.
Dependencies
- Requires the
sql.jslibrary (a JavaScript SQLite implementation) bundled with the node. - Uses Node.js filesystem module to read/write the SQLite database file.
- No external services or APIs are required.
- The SQLite database file path must be accessible and writable by n8n.
Troubleshooting
- Invalid table name error: The table name must start with a letter or underscore and contain only letters, digits, and underscores. Avoid spaces or special characters.
- Missing key or value fields: If the key or value is expected from a JSON field but missing, the node will throw an error specifying which field is missing and at which item index.
- File access errors: Ensure the SQLite file path is correct and writable. Permissions issues may cause failures reading or writing the file.
- JSON parsing errors: Stored values are saved as strings; if they are JSON strings, the node attempts to parse them on retrieval. Malformed JSON strings may cause parsing to fail silently, returning the raw string.
- Concurrent writes: Since the node reads and writes the entire SQLite file, concurrent executions might cause conflicts or data loss. Use with caution in parallel workflows.