# Why does an exported Flow's JSON structure defer to that of the HTTP Admin POST on \`/flow\` Request Body?

**URL:** <https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602>\
**Category:** Core Development\
**Created:** [26 October 2022 07:16 UTC](https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602 "2022-10-26T07:16:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shan](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@Shan](https://discourse.nodered.org/u/Shan)\
**Post date:** [26 October 2022 07:16 UTC](https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602/1 "2022-10-26T07:16:00Z")

</div>

## Description

I have successfully found a solution to deploy a desired flow to multiple node-RED instances on distinct hardware devices / VMs.

As a generic understanding of the complete workflow, a user develops a flow locally, and then exports it using the UI's Export Option.

Interesting enough, the exported JSON structure is an array e.g.

```json
[
   {}, {}
]

```

Assuming that I wish to upload this flow on multiple devices automatically I will rely on the Node-RED HTTP Admin API `POST /flow`, but according to the documentation the JSON structure is completely different than the exported JSON flow.

Question: Why? and Does the UI take care of restructuring the JSON file when using the **Import Flow** option?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 October 2022 07:35 UTC](https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602/2 "2022-10-26T07:35:53Z")

</div>

you probably want [`POST /flows`](https://nodered.org/docs/api/admin/methods/post/flows/)

And the reason an export from the editor is different is because a user facing export on the editor excludes some unnecessary info (like `rev` number)

TIP: the easiest way to determine your requirements is to watch and inspect the network tab when making various types of changes in the editor.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [26 October 2022 10:15 UTC](https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602/3 "2022-10-26T10:15:32Z")

</div>

> [@Shan](#):
>
> and then exports it using the UI's Export Option.

Instead of exporting the flow using the editor you can make a GET to /flows. The resulting file will have the proper structure to be distributed later on via HTTP Admin POST /flows.

---

<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 November 2022 11:49 UTC](https://discourse.nodered.org/t/why-does-an-exported-flows-json-structure-defer-to-that-of-the-http-admin-post-on-flow-request-body/69602/5 "2022-11-09T11:49:29Z")

</div>

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