Skip to content

Memory Blocks

Memory blocks provide persistent key-value storage for maintaining flow-level persistence. They act as a lightweight database for storing temporary data, counters, flags, or information your automation needs to remember across multiple events.

Persistent storage system built into Flows that allows you to:

  • Store and retrieve key-value pairs
  • Set optional time-to-live (TTL) values for automatic cleanup
  • Organize data using collections (namespaces)
  • Share data between different blocks

Stores a value in the memory under a specified key.

Configuration:

  • Collection: Static text value acting as namespace for your data
  • Key: JavaScript expression evaluating to key name
  • Value: JavaScript expression evaluating to value to store
  • TTL: Optional JavaScript expression evaluating to seconds before automatic deletion

Special Features: The Value field can reference the old stored value via stored variable. If key doesn’t exist, stored is undefined.

Example Usage:

// Simple Value Storage
{
"triage": outputs.triage?.object,
"triage_ts": outputs.startASlackThread.ts,
"ticket": outputs.prepareTicket,
}
// Simple counter increment
stored ? stored + 1 : 1
// Conditional update - only set if key doesn't exist
!stored ? "initial_value" : stored
// Update with timestamp
{
value: outputs.someBlock.data,
lastUpdated: new Date().toISOString(),
count: stored ? stored.count + 1 : 1
}

Retrieves a value from the memory.

Configuration:

  • Collection: Static text value matching collection used in Set operations
  • Key: JavaScript expression evaluating to key name

Output:

Emits an event with the body { collection, key, found, value?, ttl }:

  • found: boolean indicating whether the key exists
  • value: the stored value (only present when found is true)
  • ttl: seconds remaining before expiry; null if the entry has no expiry or the key was not found

Returns the entries present in a specified collection.

Configuration:

  • Collection: Collection to query from
  • Starting Key: Key to start query from
  • Limit: Maximum number of items to return (between 1 and 100)

Output:

Emits an event with the body { items, nextStartingKey }:

  • items: an array of entries, each { collection, key, value, ttl } (empty array if no keys exist)
  • nextStartingKey: cursor to pass as the Starting Key of a subsequent request for pagination (the key of the last returned entry), or null when the result is empty