# How to load JSON by passing node flow id in node-red on initial start

**URL:** <https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826>\
**Category:** General\
**Created:** [30 July 2019 09:09 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826 "2019-07-30T09:09:10Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 09:09 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/1 "2019-07-30T09:09:10Z")

</div>

I want to load JSON by passing node flow id in node-red on initial start.Please Suggest

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [30 July 2019 09:27 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/2 "2019-07-30T09:27:33Z")

</div>

Do you mean you want to start node-red and tell node-red which flows file to use?  
If so you can specify it on the command line see [https://nodered.org/docs/getting-started/local](https://nodered.org/docs/getting-started/local)

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 09:50 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/3 "2019-07-30T09:50:20Z")

</div>

Thanks for your quick response..but i need to load specific one.  
Let's say i have 3 Flows flow1,flow2,flow3 and i want to access the flow2 out of all the flows using the flow id from the JSON output. can we do that?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/4 "2019-07-30T10:21:22Z")

</div>

> [@Sohit18595](#):
>
> Let's say i have 3 Flows flow1,flow2,flow3 and i want to access the flow2 out of all the flows using the flow id from the JSON output. can we do that?

No. Node-RED loads everything in the flow file you ask it to use.

If you want it to only load one flow, then it needs to be in its own file that you load at startup.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 10:47 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/5 "2019-07-30T10:47:35Z")

</div>

Ok  
if i have 3 different application in Angular and I want to create,save 3 different flow into separate JSON and load 3 different flow for 3 application. Ho can we do this?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 10:49 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/6 "2019-07-30T10:49:03Z")

</div>

> [@Sohit18595](#):
>
> Ho can we do this?

which part in particular?

Node-RED runs the flows file it is given.

If you want different flows in different files, you'll have to create the files you want yourself.

When you start Node-RED, you can tell it which flow file to use on the command-line.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 10:52 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/7 "2019-07-30T10:52:48Z")

</div>

Suppose for 2nd Application in angular I want to create separate JSON and load that while accessing the 2nd Application. Is this possible without manually Folder creation and moving JSON to the folder?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 10:54 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/8 "2019-07-30T10:54:41Z")

</div>

It's up to you how to manage it.

I'll say it one more time. Node-RED runs the flows file you tell it to run. If you want to start Node-RED with one particular set of flows, then you start it pointed at the file containing the flows you want to run. How you do that is up to you.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 10:59 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/9 "2019-07-30T10:59:00Z")

</div>

OK  
While running we can trigger node red to load the json we want.  
and if i want to create the separate json for seaparate application is that possible?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 11:04 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/10 "2019-07-30T11:04:24Z")

</div>

> [@Sohit18595](#):
>
> and if i want to create the separate json for seaparate application is that possible?

Yes, you can create as many files as you want. How you do it is up to you.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 11:07 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/11 "2019-07-30T11:07:36Z")

</div>

but node-red used to overwrite the same file?  
am i correct?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 11:08 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/12 "2019-07-30T11:08:39Z")

</div>

To quote myself again - Node-RED uses the file you ask it to use. If you want it to use a different file you tell it to use a different file when you start.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 11:11 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/13 "2019-07-30T11:11:55Z")

</div>

But for different application i need to create different blank json file or node-red will do this for me before use?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 11:13 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/14 "2019-07-30T11:13:48Z")

</div>

> [@knolleary](#):
>
> Node-RED uses the file you ask it to use. If you want it to use a different file you tell it to use a different file when you start.

If the file doesn't exist, Node-RED will create it.

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 11:17 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/15 "2019-07-30T11:17:20Z")

</div>

Well that's good.  
one more question: Suppose I want to switch from one json file to other while single run of node-red command is it possible?  
Or I need to keep on hitting the command for with different json file?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 July 2019 11:21 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/16 "2019-07-30T11:21:34Z")

</div>

I have answered that quite a few times.

> [@knolleary](#):
>
> To quote myself again - Node-RED uses the file you ask it to use. **If you want it to use a different file you tell it to use a different file when you start.**

Another approach, if you don't want to restart Node-RED, is to use the HTTP Admin api to do an HTTP POST with the new flow configuration you want it to be running. Where you do that HTTP POST from and where _it_ gets the flow configuration you want to deploy is up to you. [POST /flows : Node-RED](https://nodered.org/docs/api/admin/methods/post/flows/)

---

<div class="post-metadata">

**Author:** ![Sohit18595](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sohit18595](https://discourse.nodered.org/u/Sohit18595)\
**Post date:** [30 July 2019 11:25 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/17 "2019-07-30T11:25:06Z")

</div>

Ok Thanks alot.

---

<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:** [30 July 2019 11:51 UTC](https://discourse.nodered.org/t/how-to-load-json-by-passing-node-flow-id-in-node-red-on-initial-start/13826/18 "2019-07-30T11:51:22Z")

</div>

By the way, if all you want to do is to have 3 different Angular front-end apps - if you don't need help from Dashboard you could use uibuilder then keep everything in a single flow.
