# What is the published format for storing NodeRED graph to a file?

**URL:** https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794
**Category:** General
**Created:** [27 October 2021 02:08 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794 "2021-10-27T02:08:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![raid2light](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@raid2light](https://discourse.nodered.org/u/raid2light)
#### Post date: [27 October 2021 02:08 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/1 "2021-10-27T02:08:32Z")

</div>

Hi, I'm wondering if there is published format on how NodeRED stores its visual node representation into a file (serializes graph GUI into a file in JSON format). So is it possible to manually create such file (by writting JSON values programmatically) and have NodeRED restore graph from it? Where is this format published? Is this purely done in JSON or some other format?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 October 2021 07:19 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/2 "2021-10-27T07:19:34Z")

</div>

Here is the read me, it contains the json formats for the graphs. You can store your charts in this format. The output of the chart node will output this data.

> <https://github.com/node-red/node-red-dashboard/blob/master/Charts.md>

---

<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: [27 October 2021 07:39 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/3 "2021-10-27T07:39:18Z")

</div>

@E1cid I think this question is about the flow file format, not dashboard charts.

@raid2light we do have this quite old wiki page that describes the basic format: [Flow Format · node-red/node-red Wiki · GitHub](https://github.com/node-red/node-red/wiki/Flow-Format)

The flow file is an array of objects, each object representing either a node, group, subflow or flow (tab).

There are a few more core properties than mentioned on that wiki page, but the basic structure is the same.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 October 2021 08:03 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/4 "2021-10-27T08:03:06Z")

</div>

You are probably right it looks like i misread that question.

---

<div class="post-metadata">

### Author: ![raid2light](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@raid2light](https://discourse.nodered.org/u/raid2light)
#### Post date: [27 October 2021 16:48 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/5 "2021-10-27T16:48:42Z")

</div>

Thanks for both suggestions, this is indeed very helpful. I was hoping to be able to programmatically update graph flow file and have NodeRED reload the graph flows with updated layout from this file (graph visual layout might change out of band based on environment and other factors). In this way this file would represent a model that I need to update so that NodeRED web page graph can adjust automatically.

Btw. is there a way to reload the layout graph from the file programmatically or via command line? Are there any examples how to automate using NodeRED in this manner?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [27 October 2021 17:04 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/6 "2021-10-27T17:04:34Z")

</div>

The Admin API - [Admin API : Node-RED](https://nodered.org/docs/api/admin/) can be used to get existing and post new flows to the server.

---

<div class="post-metadata">

### Author: ![raid2light](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@raid2light](https://discourse.nodered.org/u/raid2light)
#### Post date: [31 October 2021 22:48 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/7 "2021-10-31T22:48:37Z")

</div>

Thanks - is this recommended way to alter the flows programmatically? Would it be easier to save the flows in the file, parse the file and and then restore flows from the file once it has been updated to account for altered flows?

---

<div class="post-metadata">

### Author: ![raid2light](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@raid2light](https://discourse.nodered.org/u/raid2light)
#### Post date: [1 November 2021 21:53 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/8 "2021-11-01T21:53:19Z")

</div>

Hello, is there any example how to use Admin API? How does one invoke this API from command line? Can API be used to adjust position of the node in the graph for example? How about adjusting to what other node does selected node connects to?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [1 November 2021 22:57 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/9 "2021-11-01T22:57:44Z")

</div>

Well not really. The P in API stands for programming. So while yes you could somehow create a curl command or some such to invoke it, it would be hugely inefficient compared to just using the user interface.

---

<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: [31 December 2021 22:57 UTC](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/10 "2021-12-31T22:57:46Z")

</div>

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