Cache Set

databases · A277 · starter-package 7.0.1

Cache a value under a key for a limited time.

When to use

This block uses the add-on’s built-in cache and respects the selected expiry. Without an external provider, a cached value remains available while Nodestly stays open.

Inputs and outputs

DirectionConnectorTypeRequired
InputcacheRef — Cache profiletextno
Inputkey — Cache keytextyes
Inputvalue — Cached valuerecordyes
InputttlSeconds — Lifetime in secondsnumberno
Outputstored — Storedbooleanon success
OutputexpiresAtEpochMs — Expires atnumberon success
Input/outputfirefireno / on success

Settings

These are the saved settings and defaults. If a value is connected to the matching input, that connected value is used.

IDSettingControlDefaultBounds/options
ttlSecondsLifetime in secondsnumber300Used when the corresponding output from an earlier block is not connected.
cacheNameCachetextdefaultUsed when the corresponding output from an earlier block is not connected.

Execution and required components

Database & Query runs on this computer. Before a workflow starts, Nodestly checks it and its selected child workflows for the SQL.js component. If it is missing, one popup lists it by its friendly name. Install and start prepares it after your consent; Cancel installs nothing. Once it is ready, the popup does not appear again.

After valid input, the block performs the database action. Fire and Stored, Expires at appear only when every output value is valid.

Exact settings reference

These are the saved settings and defaults. If a value is connected to the matching input, that connected value is used.

IDSettingControlDefaultBounds/options
ttlSecondsLifetime in secondsnumber300—
cacheNamecacheNametextdefault—

Errors and recovery

  • Missing or invalid input stops before the database is changed and identifies the affected field.
  • If connected output is expired, changed, or belongs to another workflow run, reconnect it from the block that creates it.
  • SQLite errors, such as a missing table or column, are shown on this block with the concrete reason and no partial output.
  • An invalid database path or missing write permission asks you to correct the path or file permissions.
  • If SQL.js is still missing after workflow preparation, update Nodestly and Database & Query, restart the app, and run the same saved workflow again. Report the highlighted block as a product defect if this continues.

Example workflow

Choose a cache name and connect answer to key, {"value":42} to value and 300 to ttlSeconds. stored is true after writing and expiresAtEpochMs gives the expiry time. Read the value with Cache Get in the same cache.