# JSON Representation of a Flow

**URL:** <https://discourse.nodered.org/t/json-representation-of-a-flow/13893>\
**Category:** General\
**Created:** [1 August 2019 08:42 UTC](https://discourse.nodered.org/t/json-representation-of-a-flow/13893 "2019-08-01T08:42:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caracall](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@caracall](https://discourse.nodered.org/u/caracall)\
**Post date:** [1 August 2019 08:42 UTC](https://discourse.nodered.org/t/json-representation-of-a-flow/13893/1 "2019-08-01T08:42:17Z")

</div>

Hello,

I am just wondering if it is possible to get the JSON representation of a flow in an automatic way (by writing some code) without the need to export it and copying it to the clipboard (for example when I click on **Deploy** ).

Thanks in advance!

---

<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:** [1 August 2019 12:45 UTC](https://discourse.nodered.org/t/json-representation-of-a-flow/13893/2 "2019-08-01T12:45:05Z")

</div>

You could use a Watch node watching the file, and each time it changes do what you want. However I am not sure what would happen on a full deploy or a deploy of the watch node, so you might need to do something else to cope with that. Something like store a hash of the file in persistent store and check it on startup to see if it has changed.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [5 August 2019 02:54 UTC](https://discourse.nodered.org/t/json-representation-of-a-flow/13893/3 "2019-08-05T02:54:33Z")

</div>

Sounds like you just need to do an http GET of the admin api endpoint `/admin/flows`. This returns the flow that is currently running as JSON.

These and other apis are documented on [these pages](https://nodered.org/docs/api/admin/methods/)...
