Skip to content

Database

Nodes in the Database section preserve data between separate scenario executions. Set memory stores a named set of values in user or schema memory depending on Scope. Get memory reads that set and exposes its fields to subsequent nodes.

Unlike regular #var values, memory data persists between separate scenario runs.

1. Set memory

Set memory (SetMemory) stores a set of key/value pairs for the current user or the current schema depending on Scope.

Use it when a value must remain available not only in the current execution, but also in later messages or scenario runs.

Settings

Field Meaning
MemoryName Name of the stored data set
Scope User=0 (default): separate memory for each user. Schema=1: shared memory for all users of the current schema.
Fields[] List of fields containing Key and ValueTemplate
ValueTemplate Field value; supports plain text, #var, and {{ JS }}
NextAction The single output

Connections

  • Input: one standard connector.
  • Output: one NextAction.
  • The node itself does not create #node.* output variables.

Variables and templates

ValueTemplate can contain plain text, #var, and {{ JS }}.

For example:

MemoryName: checkout

city       = #node.12.city
total      = #node.20.total
short_name = {{ truncate(#member.name, 30) }}

All fields are stored together under one MemoryName.

Important details

  • A new Set memory with the same MemoryName and Scope completely replaces the previously stored data set. Fields are not merged individually.
  • If multiple fields use the same Key, the last value wins.
  • MemoryName and Scope must match between the corresponding Set memory and Get memory nodes. Identical MemoryName values in different scopes refer to different data sets.
  • Use different MemoryName values for different logical data sets.
  • User scope requires user context and is unavailable in an AI tool. Schema scope also works in AI tool schemas.

2. Get memory

Get memory (GetMemory) reads a data set previously stored with Set memory from user or schema memory depending on Scope and creates node-scoped variables for each stored field.

Settings

Field Meaning
MemoryName Name of the data set; must exactly match the corresponding Set memory
Scope User=0 (default): separate memory for each user. Schema=1: shared memory for all users of the current schema.
NextAction The single output

Available memory data sets and their fields depend on the selected Scope.

Connections

  • Input: one standard connector.
  • Output: one NextAction.

Output variables

Each memory field becomes a separate variable:

#node.{id}.{memoryField}

The output variable format #node.{id}.{memoryField} is the same for User and Schema scopes.

For example, if memory checkout contains:

{
  "city": "Kyiv",
  "total": "1200"
}

then Get memory with ID 30 creates:

#node.30.city
#node.30.total

Example

Set memory "checkout"
  -> Screen "Continue"

...

Get memory "checkout"
  -> Condition '#node.30.total != ""'

Shared schema memory

Save the support phone number in schema memory once:

Set memory
  MemoryName: contacts
  Scope: Schema
  Fields:
    supportPhone = +1 202 555 0100

Read it in another branch of the same schema:

Get memory (node 30)
  MemoryName: contacts
  Scope: Schema
  -> Screen "Support"

The Screen message uses the stored value:

Contact support: #node.30.supportPhone

All users of this schema read the same stored phone number. Both memory nodes must use MemoryName=contacts and Scope=Schema.

Important details

  • MemoryName and Scope must match between the corresponding Set memory and Get memory nodes. Identical MemoryName values in different scopes refer to different data sets.
  • MemoryName matching is case-sensitive.
  • If the memory does not exist yet, actual values are not available.
  • If several Set memory nodes use the same MemoryName and Scope, runtime reads the most recently stored data set.
  • User scope requires user context and is unavailable in an AI tool. Schema scope also works in AI tool schemas.