Here is an example of how I would save data to context and recover when server restarted.
You will need to set your context store to persistent Working with context : Node-RED
I have limited the stored data to 1000 readings,
I have edited all nodes so look at them all.
Ì have included test data, this is how you should share data, attach it to your flow as it is helpful for others to test, as they do not have access to your mqtt nodes.
Attaching files is not best practice when sharing exported flows, unless the file is to large. You should attach flow.jsons as i described above.
e.g
[{"id":"f4d9cb6bf96478c7","type":"mqtt in","z":"d1395164b4eec73e","name":"all sensors","topic":"moneo-server/Test/Deutschland/V5-KO-INO-MaschinenNR/+/Temperature","qos":"2","datatype":"auto-detect","broker":"4ce6fef99d553369","nl":false,"rap":true,"rh":0,"inputs":0,"x":223.00001525878906,"y":5901.000091075897,"wires":[["a9337d9956e1469b"]]},{"id":"a9337d9956e1469b","type":"function","z":"d1395164b4eec73e","name":"Convert message","func":"//set allowed snsors\nconst allowed_sensors = [\n 'Innen-Links', \n 'Innen-Rechts', \n 'Aussen-Links', \n 'Aussen-Rechts'\n]\n// extract sourcePath\nconst sourcePath = msg.payload.data[0].sourcePath.split(\"/\")[5].trim();\n\n// continue if allowed sensor\nif (allowed_sensors.includes(sourcePath)) {\n// Extract the relevant data from the MQTT message\n msg.payload = {\n timestamp: msg.payload.data[0].values[0].timestamp,\n value: msg.payload.data[0].values[0].value,\n sourcePath: sourcePath\n };\n// save data \n let chart_data = flow.get(\"chart_data\") ?? [];\n chart_data.push(msg.payload);\n chart_data = chart_data.slice(-1000);\n flow.set(\"chart_data\", chart_data)\n \n return msg\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":493.00001525878906,"y":5901.000091075897,"wires":[["05e73d8550f72e07","67c7d7a139f737ac"]]},{"id":"05e73d8550f72e07","type":"ui-chart","z":"d1395164b4eec73e","group":"fedf084a329203c8","name":"","label":"Temperatur Schleifen","order":1,"chartType":"line","category":"sourcePath","categoryType":"property","xAxisLabel":"Datum","xAxisProperty":"timestamp","xAxisPropertyType":"property","xAxisType":"time","xAxisFormat":"","xAxisFormatType":"HH:mm:ss","yAxisLabel":"","yAxisProperty":"value","ymin":"","ymax":"","action":"append","stackSeries":false,"pointShape":"false","pointRadius":4,"showLegend":true,"removeOlder":"3","removeOlderUnit":"86400","removeOlderPoints":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"textColor":["#666666"],"textColorDefault":true,"gridColor":["#e5e5e5"],"gridColorDefault":true,"width":6,"height":"4","className":"","x":803.0000152587891,"y":5901.000091075897,"wires":[[]]},{"id":"67c7d7a139f737ac","type":"debug","z":"d1395164b4eec73e","name":"debug 2570","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":5780,"wires":[]},{"id":"798346bd74f34d55","type":"function","z":"d1395164b4eec73e","name":"function 1","func":"msg.payload =flow.get(\"chart_data\") ?? []\nmsg.action = \"replace\"\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":503.00001525878906,"y":6101.000091075897,"wires":[["05e73d8550f72e07"]]},{"id":"4ba63a8f241c68cb","type":"inject","z":"d1395164b4eec73e","name":"reset chart","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":423.00001525878906,"y":5961.000091075897,"wires":[["05e73d8550f72e07"]]},{"id":"8744fb9558b3fc64","type":"inject","z":"d1395164b4eec73e","name":"","props":[],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":333.00001525878906,"y":6101.000091075897,"wires":[["798346bd74f34d55"]]},{"id":"57775e96caecdebc","type":"inject","z":"d1395164b4eec73e","name":"test data Innen-Rechts","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"moneo-server/Test/Deutschland/V5-KO-INO-MaschinenNR/Innen-Rechts/Temperature","payload":"{\t \"version\":\"1.0\",\t \"data\":[\t {\t \"processDataUnit\":\"°C\",\t \"tid\":\"31e4d5ae-540a-4c46-b2b0-c6146022b153\",\t \"psid\":\"Temperature\",\t \"devicePath\":\"V5-KO-INO-MaschinenNR/10.1.50.4:80/LDH292/X01/Temperature\",\t \"sourcePath\":\"Test / Deutschland /<redacted>/ V5-KO-INO-MaschinenNR / V5-KO-INO-MaschinenNR / Innen-Rechts / Temperature\",\t \"values\":[\t {\t \"timestamp\":$millis(),\t \"value\": $round($random()*10+10, 1)\t }\t ]\t }\t ]\t}","payloadType":"jsonata","x":300,"y":5800,"wires":[[]]},{"id":"4ce6fef99d553369","type":"mqtt-broker","name":"emqx","broker":"emqx","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":"","info":"Benutzt den namen des Docker-Containers direkt da sie im \r\nselben Netzwerk sind und sich über DNS finden können"},{"id":"fedf084a329203c8","type":"ui-group","name":"Temperatur Schleifen","page":"2693a6e13851f0fd","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"2693a6e13851f0fd","type":"ui-page","name":"IFM Dashboard","ui":"1805777f90e92057","path":"/IFM","icon":"home","layout":"grid","theme":"576394c7e38e257b","order":3,"className":"","visible":true,"disabled":false},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"titleBarStyle":"default"},{"id":"576394c7e38e257b","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]
[edit] update function to work with your supplied data format