Datastore Node

Datastore Node

Overview

The node is designed as a "Datastore Node" that supports operations to get, set, or clear properties in a datastore. However, based on the provided source code for the execute() method, it currently does not perform any real datastore interaction. Instead, it logs the input data and returns a JSON object containing a key indicating which operation was requested along with a timestamp.

This node could be beneficial in scenarios where you want to manage key-value pairs or properties within a datastore during workflow execution, such as retrieving configuration values, updating stored settings, or clearing stored data. Practical examples might include:

  • Retrieving an API key stored in a datastore before making an API call.
  • Updating user preferences saved in a datastore.
  • Clearing cached data after a certain event.

However, the current implementation acts more like a placeholder or stub rather than performing actual datastore operations.

Properties

Name Meaning
Field in Datastore The specific field/key in the datastore to operate on (e.g., "spreadsheet_id"). Required.

Note: The property "Field in Datastore" is required and used to specify which datastore field the operation should target.

Output

The output of the node is an array containing one item with a JSON object. This JSON object has a single property:

  • key: A string combining the operation name (setDatastoreProperty, getDatastoreProperty, or clearDatastoreProperty) and the current ISO timestamp when the node executed.

Example output JSON:

{
  "key": "getDatastoreProperty 2024-06-01T12:00:00.000Z"
}

No binary data output is produced by this node.

Dependencies

  • No external services, APIs, or credentials are used in the current implementation.
  • The node depends on the n8n workflow framework for its base classes and error handling.

Troubleshooting

  • Operation Not Implemented Error: If an unsupported operation is specified, the node throws an error stating the operation is not implemented. To resolve, ensure the operation parameter is one of the supported values: getDatastoreProperty, setDatastoreProperty, or clearDatastoreProperty.
  • No Actual Datastore Interaction: Users expecting real datastore functionality will find none. This node currently only returns a timestamped key string. To implement real datastore logic, additional code integration is needed.

Links and References

Discussion