Keeping state in Flows
Many use cases require some information to be kept between multiple runs of the Flow, e.g. to remember the last time a Flow ran so that dynamic queries to get updates from a database or a service can be created.
For these purposes the Crosser Node has a built-in key/value store that is accessed through the ‘Key Value Set/Get/Delete’ modules. A Flow can use multiple stores and each store can keep any number of keys. The values assigned to keys can be simple values, like a number, or complex structures like a hierarchical object or an array. Each store can either be kept in memory, or stored on disk. The latter is useful if you don’t want to lose the data (state) when restarting the Flow. Stores on disk can also be accessed from any Flow and can therefore be used to share data between Flows running on the same Node. However, if you just need to transfer data from one Flow to another, the MQTT broker is a better option.
To see an example of using the ‘Key Value’ modules, take a look at the ‘Change Data Capture’ FlowApps.
Crosser Example | Change Data Capture Flow