# Changing flows\_cred.json values at runtime

**URL:** <https://discourse.nodered.org/t/changing-flows-cred-json-values-at-runtime/83173>\
**Category:** General\
**Tags:** express\
**Created:** [25 November 2023 10:45 UTC](https://discourse.nodered.org/t/changing-flows-cred-json-values-at-runtime/83173 "2023-11-25T10:45:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guillad](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@guillad](https://discourse.nodered.org/u/guillad)\
**Post date:** [25 November 2023 10:45 UTC](https://discourse.nodered.org/t/changing-flows-cred-json-values-at-runtime/83173/1 "2023-11-25T10:45:20Z")

</div>

Hi everyone!  
My current environment is [Node-Red Express](https://github.com/bigdoods/node-red-express) and I'd like to be able to modify the flows\_cred.json values at **runtime** without restarting Node Red. In this way, I thought, the configuration nodes' credentials can be automatically saved every time Node Red restarts, as I couldn't do it in the `settings.js` file ('credentialSecret'). The flows\_cred.json file is changed indeed when the credential for a new node (e.g. Dropbox) is added. However, when I rewrite the file at runtime, the values were overwritten, but nothing happened. There are still nodes that prompt for API keys that are missing. Any ideas? Is it even possible? Also, I looked in previous posts here, but did not find an answer.  
Here's my flow. Thanks for your help:)

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

```auto
[{"id":"ce2af8611ac69557","type":"inject","z":"01ea9a32d834b1d1","name":"Read","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":470,"y":2040,"wires":[["5ec2d01b3f965a59"]]},{"id":"5ec2d01b3f965a59","type":"file in","z":"01ea9a32d834b1d1","name":"Current flows_cred.json","filename":"./flows_cred.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":670,"y":2040,"wires":[["edba61c0ce961690"]]},{"id":"879bcaf27cd56d57","type":"debug","z":"01ea9a32d834b1d1","name":"debug 331","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":945,"y":2040,"wires":[],"l":false},{"id":"cbfb8e4cefeff163","type":"inject","z":"01ea9a32d834b1d1","name":"Write","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"$\":\"564004............\"}","payloadType":"json","x":450,"y":2100,"wires":[["5411d82543fbb210"]]},{"id":"5411d82543fbb210","type":"file","z":"01ea9a32d834b1d1","name":"NEW flows_cred.json","filename":"./.flows_cred.json","filenameType":"str","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":660,"y":2100,"wires":[["3844099f4b8ea3b5"]]},{"id":"3844099f4b8ea3b5","type":"debug","z":"01ea9a32d834b1d1","name":"debug 332","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":845,"y":2100,"wires":[],"l":false},{"id":"61c927818e1a4c19","type":"inject","z":"01ea9a32d834b1d1","name":"Recently changed files","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"find . -mmin -5","payloadType":"str","x":500,"y":2180,"wires":[["c4a393200c8ac118"]]},{"id":"c4a393200c8ac118","type":"exec","z":"01ea9a32d834b1d1","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":690,"y":2180,"wires":[["fb83d00784e3b1da"],["fb83d00784e3b1da"],["fb83d00784e3b1da"]]},{"id":"fb83d00784e3b1da","type":"debug","z":"01ea9a32d834b1d1","name":"debug 333","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":835,"y":2180,"wires":[],"l":false},{"id":"edba61c0ce961690","type":"json","z":"01ea9a32d834b1d1","name":"","property":"payload","action":"","pretty":false,"x":850,"y":2040,"wires":[["879bcaf27cd56d57"]]}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 November 2023 11:32 UTC](https://discourse.nodered.org/t/changing-flows-cred-json-values-at-runtime/83173/2 "2023-11-25T11:32:50Z")

</div>

once you have re-written them you need to then restart node-red so it re-reads them.

---

<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:** [9 December 2023 11:33 UTC](https://discourse.nodered.org/t/changing-flows-cred-json-values-at-runtime/83173/3 "2023-12-09T11:33:23Z")

</div>

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