Contents

Memory Cache Get Or Compute

memory-cache-get-or-compute · Nodes · Control

Reads a cached value or computes and stores it on miss.

Memory Cache Get Or Compute#

Process-local, per-workspace memory cache node with an embedded compute body.

Inputs#

  • input — required. Used for key interpolation and passed into the compute body on miss.

Outputs#

  • output — cached value or newly computed value.
  • compute — connect to the first node in the compute body. Runs only on cache miss.

Config#

  • namespace — lowercase letters, digits, dashes, 1-127 chars.
  • key — key template. Supports {{ input.foo }}. Final key must match the same lowercase/dash rules.
  • time_to_idle_seconds — 60-900.
  • time_to_live_seconds — 60-900, must be >= idle.

Concurrent misses for the same workspace/namespace/key share one compute reservation. Waiters receive the computed value.

Binary values may be cached. Binary values cannot be interpolated into keys.

The cache is capped at 15 MiB per workspace. Computes fail if storing the result would exceed the cap.

Null compute output fails because it would stop propagation. Undefined compute output is valid and cached.

Inputs

  • inputRequired

Outputs

  • output
  • compute

Configuration

FieldTypeRequiredDescription
namespacestringNoCache namespace, lowercase letters, digits, and dashes
keystringNoCache key template. Final value must be lowercase letters, digits, and dashes
time_to_idle_secondsintegerNoSeconds before an idle cache entry expires
time_to_live_secondsintegerNoMaximum seconds a cache entry may live
base_configrecordNoShared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow).