# Deploy/ launch a node-red flow with a shortcut on raspberry

**URL:** <https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366>\
**Category:** General\
**Created:** [18 June 2019 16:27 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366 "2019-06-18T16:27:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Savoiecraft74](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Savoiecraft74](https://discourse.nodered.org/u/Savoiecraft74)\
**Post date:** [18 June 2019 16:27 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/1 "2019-06-18T16:27:30Z")

</div>

Hello guys,  
I'm in the projet of making a kind of on-board computer for my tractor with a Raspberry pi, the main purpose of this will be to collect data from the baler attached to the tractor. Anyway, is just a matter of detecting a signal on a GPIO pin, and make an action. I had think that node-red would be a good idea, but I would-like to be able to have a shortcut on the Rpi Desktop that will deploy the flow on node red and launch the dashboard of the baler. I was thinking of a script but I'm quite lost with node-red, I only used it one time during my studies.

cheers

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 June 2019 16:39 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/2 "2019-06-18T16:39:35Z")

</div>

Why not just have node-red running all the time and have a shortcut to the browser to open the dashboard url?

---

<div class="post-metadata">

**Author:** ![Savoiecraft74](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Savoiecraft74](https://discourse.nodered.org/u/Savoiecraft74)\
**Post date:** [18 June 2019 18:23 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/3 "2019-06-18T18:23:29Z")

</div>

yes, but I would have the possibility to make other flows for other implements..  
knowing that each flows will use the same pins

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 June 2019 18:51 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/4 "2019-06-18T18:51:47Z")

</div>

In that case you will have to write a script to start node red with the flow file you want. Also you will need to be able to kill that instance when you want to.

---

<div class="post-metadata">

**Author:** ![Savoiecraft74](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Savoiecraft74](https://discourse.nodered.org/u/Savoiecraft74)\
**Post date:** [18 June 2019 19:31 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/5 "2019-06-18T19:31:06Z")

</div>

First thank for your answers.  
I've seen that you can lauch node-red with a specific settings.json file, it's with this option or there is another option ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 June 2019 19:50 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/6 "2019-06-18T19:50:25Z")

</div>

Pretty sure that if you run  
`node-red path/to/flowfile.json`  
that it will use that file. You can easily test that.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 June 2019 15:15 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/7 "2019-06-20T15:15:09Z")

</div>

You might want to go a bit further, you can give Node-RED a completely different userDir folder which contains flow, credentials, projects, settings.

```auto
node ../node_modules/node-red/red.js --userDir ../data

```

In the above case, I am executing a version of Node-RED installed to a specific folder, the script to call it would need to be in the same folder as Node-RED was installed to. Adjust the path to Node-RED and the userDir according to need.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [20 June 2019 15:28 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/8 "2019-06-20T15:28:01Z")

</div>

Possibly a bit of a different approach than most are suggesting here, but what about having the flows coexist and use a switch node to evaluate what flow should be receiving the data at a given time? You could set up a dropdown on the dashboard and send the output to the variable.

---

<div class="post-metadata">

**Author:** ![Savoiecraft74](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Savoiecraft74](https://discourse.nodered.org/u/Savoiecraft74)\
**Post date:** [25 June 2019 21:37 UTC](https://discourse.nodered.org/t/deploy-launch-a-node-red-flow-with-a-shortcut-on-raspberry/12366/9 "2019-06-25T21:37:25Z")

</div>

Thanks for all of your answers, I don't know now how I will do it but I'm pretty sure I will find a solution with your answer.
