Overview
This node provides caching functionality by reading from or writing to an object storage bucket compatible with the MinIO API. It is useful for scenarios where you want to temporarily store data items and retrieve them later, avoiding repeated processing or external calls.
Typical use cases include:
- Caching API responses or computationally expensive results.
- Storing intermediate workflow data for reuse in subsequent executions.
- Implementing simple persistent state management within workflows.
For example, you can write a dataset into a cache bucket under a specific key, then later read it back to avoid recalculating or refetching the same data.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the storage bucket where cached data will be stored or retrieved from. |
| Key | One or multiple keys identifying the cached item(s). These keys are hashed internally to form unique cache paths. |
| Disabled | When enabled (true), disables the cache operation for that item, effectively bypassing caching logic. |
Output
- For the Write operation, the node outputs the original input data unchanged.
- For the Read operation, the node outputs two streams:
- The first output contains the cached JSON data retrieved from the bucket, structured as standard n8n items.
- The second output contains the original input items for which no cache was found or caching was disabled.
The cached data is stored and retrieved as JSON files named item.json inside a path derived from the workflow ID and a SHA256 hash of the key. If binary data exists on the input item during write, it is also stored separately in the bucket under the hashed key path, preserving MIME types.
Dependencies
- Requires access to a MinIO-compatible object storage service.
- Needs credentials providing authentication to this storage service.
- Uses the MinIO client library to interact with the storage bucket.
- Requires the bucket specified to already exist; the node does not create buckets automatically.
Troubleshooting
- Bucket does not exist: The node throws an error if the specified bucket is missing. Ensure the bucket is created beforehand in your MinIO or compatible storage.
- Error storing item in cache: Indicates issues writing JSON or binary data to the bucket. Check permissions and connectivity to the storage service.
- Error reading item from cache: Occurs when fetching cached data fails due to reasons other than a missing key. Verify network access and bucket contents.
- Cache disabled flag: If set to true, the node skips caching logic for that item, which may lead to unexpected cache misses if misunderstood.