# Reload current flow

**URL:** <https://discourse.nodered.org/t/reload-current-flow/42610>\
**Category:** General\
**Created:** [14 March 2021 11:09 UTC](https://discourse.nodered.org/t/reload-current-flow/42610 "2021-03-14T11:09:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 March 2021 11:09 UTC](https://discourse.nodered.org/t/reload-current-flow/42610/1 "2021-03-14T11:09:28Z")

</div>

I am using this code to manually reload all flows programmatically:

```auto
[{"id":"4b927842.61ab08","type":"group","z":"93b9b6f5.e51a08","name":"Reload all flows","style":{"label":true},"nodes":["e3f0c29b.15917","62e6b42a.d2df5c","40715257.e3114c","27f2916.2d1306e","cbf97372.7169f"],"x":14,"y":939,"w":992,"h":82},{"id":"e3f0c29b.15917","type":"function","z":"93b9b6f5.e51a08","g":"4b927842.61ab08","name":"Request Token","func":"msg.payload = {\n \"client_id\": \"node-red-editor\",\n \"grant_type\": \"password\",\n \"scope\": \"*\",\n \"username\": \"username\",\n \"password\": \"password\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":340,"y":980,"wires":[["40715257.e3114c"]]},{"id":"62e6b42a.d2df5c","type":"inject","z":"93b9b6f5.e51a08","g":"4b927842.61ab08","name":"Manual reload","props":[{"p":"payload","v":"","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":130,"y":980,"wires":[["e3f0c29b.15917"]]},{"id":"40715257.e3114c","type":"http request","z":"93b9b6f5.e51a08","g":"4b927842.61ab08","name":"Token","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://localhost:1880/auth/token","tls":"","persist":false,"proxy":"","authType":"","x":530,"y":980,"wires":[["27f2916.2d1306e"]]},{"id":"27f2916.2d1306e","type":"function","z":"93b9b6f5.e51a08","g":"4b927842.61ab08","name":"Confirm token","func":"// get the status of the request\nvar status = msg.statusCode;\n//var token = {};\nvar token = '';\nmsg.headers ={};\n\n//let node = feedback;\n\nswitch(status){\n case 200:\n node.log(\"Secure restart\");\n token = JSON.parse(msg.payload);\n token = 'Bearer '+token.access_token;\n msg.headers = {\n \"Authorization\": token,\n \"Node-RED-Deployment-Type\":\"reload\"\n }\nmsg.payload =\"\";\n break;\n case 204:\n node.log(\"Secure without restart\");\n global.set('result','\tSuccess - with no further content');\n break;\n case 400:\n node.warn(\"Bad request\");\n break;\n case 401:\n node.warn(\"Not authorized\");\n break;\n case 403:\n node.warn(\"Forbidden\");\n break;\n case 404:\n node.log(\"Unsecure restart\");\n msg.headers = {\n \"Node-RED-Deployment-Type\":\"reload\"\n }\n break;\n case 409:\n node.warn(\"Version mismatch\");\n break;\n case 500:\n node.error(\"Server Error\");\n break;\n default:\n node.warn(\"Unknown Error\");\n break;\n}\n\nmsg.payload = \"\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":980,"wires":[["cbf97372.7169f"]],"info":"Restart of Node-Red flows.\nWill check if the action needs security or not.\nNote: if the first 5 attemps return a statuscode 403 'forbidden'\nthen the server will break and only way to recover is then to\nrestart the service"},{"id":"cbf97372.7169f","type":"http request","z":"93b9b6f5.e51a08","g":"4b927842.61ab08","name":"Restart","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://localhost:1880/flows","tls":"","persist":false,"proxy":"","authType":"","x":920,"y":980,"wires":[[]]}]

```

I'd like to know if there a similar way to reload only the current flow tab in which the code is deployed?

---

<div class="post-metadata">

**Author:** ![Ashfaak](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ashfaak/32/34409_2.png) [@Ashfaak](https://discourse.nodered.org/u/Ashfaak)\
**Post date:** [14 March 2021 14:04 UTC](https://discourse.nodered.org/t/reload-current-flow/42610/2 "2021-03-14T14:04:28Z")

</div>

A few months ago it was not possible: [Automatically restart one flow (not all flows) - #3 by knolleary](https://discourse.nodered.org/t/automatically-restart-one-flow-not-all-flows/34813/3)

> [@Automatically restart one flow (not all flows)](https://discourse.nodered.org/t/automatically-restart-one-flow-not-all-flows/34813/3):
>
> To answer your question directly, there is no API for restarting an individual flow.
> 
> The whole /flow API is in need of an overhaul. Adding the ability to restart an individual flow was not something on my list to consider for the overhaul - it is now.

I don't think it is possible yet.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 March 2021 14:10 UTC](https://discourse.nodered.org/t/reload-current-flow/42610/3 "2021-03-14T14:10:02Z")

</div>

What a pity.  
Thanks!

---

<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:** [13 May 2021 14:10 UTC](https://discourse.nodered.org/t/reload-current-flow/42610/4 "2021-05-13T14:10:25Z")

</div>

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