Memory Store
Last modified: 10 February 2025
Note that as well as using the Memory Store Block, you can also access it from Javascript code using
const value = memStore.get('hubspotUsers')
This example shows a couple of points of interest.
The Memory Store Block itself.
The use of two Terminator Blocks.
The Flow logic is as follows.
Try to get the key hubspotUsers from the Memory Store.
If it's not there, get it from the Hubspot API and then add it to the Memory Store.
If it is there, then return the store's value.
Send the resulting data back to the calling Flow or API.
In the screenshot, you can see that we have run this Flow twice in the editor.
The first time, you can see the console message 'Not in mem store'.
The second time 'In mem store'.
Get
The get operation is pretty self-explanatory. All you have to ensure is that your keys are unique.
If it returns data, then it is put on the OK edge. If not, it passes to the null edge.
Set
This takes the incoming edge data and stores it. However, it also allows you to specify a timeout period.
Each time you perform a get operation, it checks to see if the timeout period has elapsed. If it has, it returns a null
value.