n8n-nodes-datatable-cache
v0.1.3
Published
Read-through / write-back cache node backed by an n8n data table
Maintainers
Readme
n8n-nodes-datatable-cache
A Data Table Cache node for n8n: a read-through / write-back cache backed by an n8n data table, with hit/miss routing and TTL expiry.
📦 npm: n8n-nodes-datatable-cache
Requirements: an n8n version whose public API serves
/api/v1/data-tables(older instances return 404), andexecutionOrder: v1(the default on recent n8n).
What it does
Two inputs (Input, Update), two outputs (Cache Hit, Cache Miss), wired as a loop:
Input ─▶ ┌─ Data Table Cache ─┐ ─▶ Cache Hit → use payload
Update ─▶ └────────────────────┘ ─▶ Cache Miss → work ─┐
▲──────────────── Update ───────────────┘- Input — look up by key. A fresh hit emits the cached payload on Cache Hit; a miss or
expired hit emits the item on Cache Miss (with the stale row under
_staleRow). - Update — write processed items back; each is upserted and re-emitted on Cache Hit.
Wire it as a loop: Cache Miss → your work → the Update input; take Cache Hit onward.
➡️ Setup — one-time install: community node, data table, API key, credential (with screenshots). ➡️ Usage guide — per-workflow: importable example, node config, the cache loop, TTL, and evicting expired rows.
Install
Community node (n8n Settings → Community Nodes → Install):
n8n-nodes-datatable-cache.
Setup (quick)
- Data table with columns
cache_key,payload,last_modified(and optionallast_access) — see Setup. - Credential: the built-in n8n API credential — an API key (with
dataTable*scopes) and a Base URL ending in/api/v1.
Parameters
| Parameter | Default | Notes |
| -------------------- | --------------- | ---------------------------------------------------- |
| Data Table | — | Pick from list or enter the table ID |
| Key Column | cache_key | Column matched against the cache key |
| Cache Key | — | Value to look up (Input) or store under (Update) |
| Payload Column | payload | Holds the JSON-stringified payload |
| Last Modified Column | last_modified | ISO timestamp of the last write |
| Last Access Column | last_access | ISO timestamp of the last hit (optional; leave empty to skip) |
| Max Age + Unit | 3600 s | A hit older than this becomes a miss |
| Measure From | Last Modified | Whether TTL counts from last_modified or last_access |
Limitations
- Expiry: TTL only (filter-condition mode planned).
- Concurrency: last-write-wins — fine for a cache, not for transactional data.
- Malformed payload: degrades to
{ _raw: <value> }rather than throwing. - Continue On Fail: errored items are emitted with an
errorfield (lookup → Cache Miss, store → Cache Hit) instead of failing the run.
Development
npm install
npm run build # tsc + copy assets to dist/
npm run lintAll data-table I/O is isolated in nodes/DataTableCache/stores/ behind the CacheStore
interface; client.ts (dataTableRequest) is the single line to revisit on n8n API changes.
