Skip to content

Store data in Node Red memory

bartbutenaers edited this page Jul 26, 2021 · 2 revisions

Sometimes information need to be stored (in Node-RED memory), to have that information available:

  • At a later moment in time.
  • In another node.

Node-RED offers 3 locations (in Node-RED memory) where the information can be stored:

  • Node: for information that needs to be available only to the node that stored the value
  • Flow: for information that needs to be available for all nodes on the same flow (i.e. same tabsheet in the flow editor)
  • Global: for information that needs to be available for all nodes

The following animation shows how to accomplish these steps:

  1. Create a property 'myFlow' on flow memory with value 'flowValue'.
  2. Create a property 'myGlobal' on flow memory with value 'globalValue'.
  3. Create a property 'myNode' on flow memory with value 'nodeValue'.

blockly_object_demo

Remark: the node memory is also called 'context'.