Saltar al contenido principal

Cache

Category: Data
Node id: cache

In-memory key-value cache with TTL expiration for pipeline data

What it does​

  • Six cache operations: get, set, delete, exists, clear, stats
  • TTL-based expiration with automatic cleanup goroutine
  • Thread-safe concurrent access with RWMutex
  • Cache statistics reporting (active, expired, total entries)

Use cases​

  • Cache FHIR terminology lookups to avoid repeated API calls
  • Store intermediate pipeline results for reuse across steps
  • Deduplicate repeated requests within a pipeline execution

Runtime​

  • Performance tier: fast

Input ports​

NameTypeRequiredDescription
keytextNoCache key (overrides config)
valueanyNoValue to store (for set operation)
ttlnumberNoTTL override in seconds (for set operation)

Output ports​

NameTypeRequiredDescription
resultjsonNoFull cache operation result with key, hit status, and metadata
valueanyNoRetrieved value (for get operation)
successbooleanNoWhether the cache operation succeeded

Settings​

Basic​

SettingNameTypeRequiredDefaultAllowed valuesDescription
OperationoperationenumYesgetget, set, delete, exists, clear, statsCache operation to perform
KeykeystringNoCache key
TTL (seconds)ttlnumberNo3600min 1Time to live in seconds for set operation

Errors​

CodeDescription
MISSING_KEYCache key is required for get, set, delete, and exists operations
MISSING_VALUEValue is required for set operation
UNSUPPORTED_OPERATIONThe specified cache operation is not recognized

Runtime notes​

  • On cache miss, result.hit is false and value is null — wire both outputs to handle miss vs hit in downstream logic
  • value output is null for all operations except get — do not wire it for set, delete, exists, clear, or stats
  • Cache is in-memory per node instance and does not persist across pipeline restarts
  • Expired entries return hit=false; a background goroutine cleans up expired entries every 5 minutes

See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.

¿Algo no está claro? Envíe sus comentarios sobre la documentación por correo electrónico..