# \[SOLVED\] How to import and deploy a flow from a bash script?

**URL:** <https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180>\
**Category:** General\
**Created:** [15 May 2019 19:51 UTC](https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180 "2019-05-15T19:51:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![njager](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@njager](https://discourse.nodered.org/u/njager)\
**Post date:** [15 May 2019 19:51 UTC](https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180/1 "2019-05-15T19:51:53Z")

</div>

hi,  
I have a docker image with node-red running. I would like to know if (and how) it is possible to import a flow saved in a text file then to deploy it. My goal is to give a docker ready to deploy with a flow automaticaly imported and deployed (using bash script) when they start their own container

---

<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:** [15 May 2019 21:05 UTC](https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180/2 "2019-05-15T21:05:45Z")

</div>

If you are trying to "import" a complete flow file then you don't need to import that. All you need to do is to transfer it to the correct folder and either rename it or - probably better - change the startup to use a generic flow file name.

The flow file is simply a JSON text file.

---

<div class="post-metadata">

**Author:** ![njager](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@njager](https://discourse.nodered.org/u/njager)\
**Post date:** [16 May 2019 11:02 UTC](https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180/3 "2019-05-16T11:02:03Z")

</div>

Hi TotallyInformation  
thanks for your answer. Yes I want to use a complete flow. I'ill try to do what you propose.

---

<div class="post-metadata">

**Author:** ![njager](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@njager](https://discourse.nodered.org/u/njager)\
**Post date:** [17 May 2019 13:21 UTC](https://discourse.nodered.org/t/solved-how-to-import-and-deploy-a-flow-from-a-bash-script/11180/4 "2019-05-17T13:21:09Z")

</div>

To conclud,  
I saw in `settings.js` it is possible to set a `flowFile` however for some reason, I can' t make it work (I don' t know what I did wrong). Anyway I solve the problem by just adding the `json` file when I start node-red.  
that way when I pop a docker, the flow is automatically deployed.

thx again TotallyInformation
