# Flow context not being saved over NR restarts

**URL:** <https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829>\
**Category:** General\
**Created:** [13 November 2023 14:36 UTC](https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829 "2023-11-13T14:36:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [13 November 2023 14:36 UTC](https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829/1 "2023-11-13T14:36:25Z")

</div>

I've got this in my settings.js

```auto
     /** Context Storage
      * The following property can be used to enable context storage. The configuration
      * provided here will enable file-based context that flushes to disk every 30 seconds.
      * Refer to the documentation for further options: https://nodered.org/docs/api/context/
      */
     contextStorage: {
         default: {
             module:"localfilesystem"
         },
     },

```

but I'm losing the values of my flow context variables when I re-start NR

How do I go about debugging what the issue is?  
NR running on Win11

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [13 November 2023 14:50 UTC](https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829/2 "2023-11-13T14:50:08Z")

</div>

How is Node-RED restarting? e.g. is it shutting down gracefully or failing due to a out of memory error or similar?

Also not the entry in the docs:

> it caches the values in memory and only writes them out to the file-system every 30 seconds.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [13 November 2023 14:53 UTC](https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829/3 "2023-11-13T14:53:58Z")

</div>

#PEBKAC issue

I hadn't edited the right settings.js file!

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/4525a0d37591f4d33094b1525ce0d8d0e983d9d6.png)

I think I need to go and have a lie-down 🙂

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6abfe7b4ec6bc5fd395e565ada1e9fa87a0dcb0c.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 November 2023 14:54 UTC](https://discourse.nodered.org/t/flow-context-not-being-saved-over-nr-restarts/82829/4 "2023-11-27T14:54:55Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
