# How to call the interface of the export function in nodered

**URL:** https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341
**Category:** General
**Created:** [27 May 2021 12:45 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341 "2021-05-27T12:45:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![lei1](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lei1](https://discourse.nodered.org/u/lei1)
#### Post date: [27 May 2021 12:45 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/1 "2021-05-27T12:45:27Z")

</div>

Hello everyone.  
I want to use the "export" function in the upper right corner of nodered, where is this function and how to call it?

---

<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 May 2021 12:49 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/2 "2021-05-27T12:49:50Z")

</div>

Hi @lei1

you can open the export dialog using the code:

```auto
RED.actions.invoke("core:show-export-dialog")

```

---

<div class="post-metadata">

### Author: ![lei1](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lei1](https://discourse.nodered.org/u/lei1)
#### Post date: [27 May 2021 12:52 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/3 "2021-05-27T12:52:21Z")

</div>

Thanks, how to call this function in the function node, get the information of the node and print it to the console

---

<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 May 2021 12:55 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/4 "2021-05-27T12:55:14Z")

</div>

A Function node cannot call this function.

The Function node runs in the runtime part of node-red. The export dialog is in the editor.

Can you describe in more detail what you are trying to do and where you want the code to run?

---

<div class="post-metadata">

### Author: ![lei1](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lei1](https://discourse.nodered.org/u/lei1)
#### Post date: [1 June 2021 04:03 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/6 "2021-06-01T04:03:59Z")

</div>

How to automatically collect all node information and print it to the console, (define a function node to do this instead of manually clicking the export button in the upper right corner)

---

<div class="post-metadata">

### Author: ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)
#### Post date: [1 June 2021 05:15 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/7 "2021-06-01T05:15:27Z")

</div>

The content of the export is the content of the flows.json file which you can find in you nodered folder under the name flows\__yourhostname_.json.  
To get the content of this file into nodered you can use a file in node.  
For example on a raspberry pi in the stock configuration if nodered was installed with the standard install script put `/home/pi/.node-red/flows_raspberrypi.json` in the file in node and you will get the whole content.

Johannes

---

<div class="post-metadata">

### Author: ![lei1](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lei1](https://discourse.nodered.org/u/lei1)
#### Post date: [2 June 2021 04:47 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/9 "2021-06-02T04:47:30Z")

</div>

For example, in a process, three different nodes are deployed to form a process, how to automatically obtain the json information of this process through the fourth node and print it to the console

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [2 June 2021 10:29 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/10 "2021-06-02T10:29:08Z")

</div>

There is no `easy way to do this. However here is a possible solution. First you would have to have to create a dummy file, maybe call it ‘previous.flow’. Next you would need an inject node set to run when ever you do a deploy. This would be connect to a file node that would read the current flow file.

Now you have access to the old flow and new flow, you would have to do a comparison of the two and send the differences to the console. I’d suggest you change the settings.js to save the flows in a form that is easier to read. See [Settings file : Node-RED](https://nodered.org/docs/user-guide/runtime/settings-file)

---

<div class="post-metadata">

### Author: ![lei1](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@lei1](https://discourse.nodered.org/u/lei1)
#### Post date: [3 June 2021 02:29 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/11 "2021-06-03T02:29:09Z")

</div>

Thank you so much

---

<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: [2 August 2021 08:42 UTC](https://discourse.nodered.org/t/how-to-call-the-interface-of-the-export-function-in-nodered/46341/13 "2021-08-02T08:42:12Z")

</div>

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