Skip to main content Skip to footer

Key Value Set Documentation

Version: 3.0.0

Retrieved: 2025-10-09 15:16:00


Key Value Set

Sets values identified by a key to a storage in memory or on disk.

Modes

The module can operate in two different modes which are configured by the Persistent Storage setting. A flow can have multiple different key value stores in the same flow and they don't need to use the same mode. Stores can also be separated by using a unique Store Name for each store.

It is possible to have an persistent store and an in-memory store with the same Store Name, in the same flow or in a different flow, but be aware that they are two separate stores and cannot be accessed from the same module.

This module will create a new store if a store named Store Name does not exist.

Persistent storage mode

Module sets values to persistent key value store. Persistent key value stores are available from all flows, which means the if a Key Value Set module sets a value in flow 1 it will also be available to all other flows on the Node as long as they use the same Store Name.

In-memory mode

This mode is selected by setting Persistent Storage to false. In this mode the module sets values to an in memory key value store. In memory key value stores are only available from modules in the same flow. Values saved to the store are available as long as the flow is running, but when the flow stops, the store is cleared.

Settings

Name Requirements Purpose Default
Key String with length 1 to 64 Key to set. Use template syntax to set the key from the message, e.g. {key}. key
Path String with length 0 to 64 Path that specifies which property of key to set. Use template syntax to set the path from the message, e.g. {path}.  
Value Property String with length 1 to 64 Property on the incoming message that contains the Value. value
Store Name String with length 1 to 64 Set a unique name for the store. Key value get/set modules can only access one store. global
Persistent Storage Boolean Set to true if connecting to persistent key value store. true
Ignore Warnings Boolean Set to true to ignore warnings for missing 'Key' or 'Path'. false

Input

A message containing a value property specified by the Value Property setting. Key and/or Path can be taken from the input message, if template syntax is used in the settings.

Output

The same as the data passed in including the Crosser result of the operation

Examples

Setting a value to persistent storage.

# Settings:
Key={key}
Value Property=value
Path=
Store Name=MyStorage
Persistent Storage=true

# Incoming message:
{
    "key": "user",
    "value": {
        "sensorId": "Outside1",
        "temperature": 42,
        "description": null,
        "tags": [
            "outside",
            "London"
        ]
    }
}


# Outgoing message:
{
    "key": "user",
    "value": {
        "sensorId": "Outside1",
        "temperature": 42,
        "description": null,
        "tags": [
            "outside",
            "London"
        ]
    },
    "crosser": {
        "success": true
    }
}

Updating part a value to persistent storage. In this example the previous example has already been executed.

# Settings:
Key={key}
Value Property=value
Path={path}
Store Name=MyStorage
Persistent Storage=true

# Incoming message:
{
    "key": "user",
    "path": "sensorId",
    "value": "Outside2",
}


# Outgoing message:
{
    "key": "user",
    "path": "sensorId",
    "value": "Outside2",
    },
    "crosser": {
        "success": true
    }
}