# Help with runtime-API!

**URL:** <https://discourse.nodered.org/t/help-with-runtime-api/147>\
**Category:** General\
**Created:** [13 May 2018 17:10 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147 "2018-05-13T17:10:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![selo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selo/32/1236_2.png) [@selo](https://discourse.nodered.org/u/selo)\
**Post date:** [13 May 2018 17:10 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/1 "2018-05-13T17:10:35Z")

</div>

Hello everyone,  
I have embedded nodered. I’m working with the runtime-api.  
I can launch the runtime and a flow.  
The flow is: [inject-\> function (n + n) -\> debug] (mm, yes, this is why I do not work at NASA ;-))

I get to make inquiries through the API successfully. But I can not access the result of the function or the final payload of the flow.  
I’ve tried things like this:  
RED.nodes.getNode (‘id\_node’). payload  
RED.log.log (‘msg\_id\_from\_editor’)

The node.log method redirects to the standard output of the main application correctly. But I’m looking for a way to bidirectional communication main\_nodeapp \<-\> runtime-nred.

Thank you .

---

<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:** [13 May 2018 19:34 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/2 "2018-05-13T19:34:14Z")

</div>

The runtime api (which is not formally documented etc etc) doesn’t provide any functions for interacting with flows. If you want to do so, you’d need to use nodes that you can interact with. For example, with the default palette, you could create a flow that listened on a TCP port and responded to it.

The better way would be to create a custom pair of nodes that expose themselves programmatically. We’ve had an item on the backlog to create such a set of nodes for a long time - [https://trello.com/c/9pg4nqFX](https://trello.com/c/9pg4nqFX) - just not got to it.

---

<div class="post-metadata">

**Author:** ![selo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selo/32/1236_2.png) [@selo](https://discourse.nodered.org/u/selo)\
**Post date:** [13 May 2018 21:08 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/3 "2018-05-13T21:08:32Z")

</div>

Thank you,  
good in this particular case **I have disconnected the editor and the server**. I just have running the flow inside my nodeapp. Everything is perfect and I get some kind of interaction through text files, clipboard, etc. But I need to share variables or be able to read from mynodeapp some flow value. I do not want to raise the server or use any port.

What you tell me makes me ask certain things:

- From the runtime-api I can not read variables or messages?
- Could I read fields or values of nodes from runtime-api ?
- When you talk about creating a pair of nodes, would they be nodes that speak directly with node.js?
- In the documentation, some functions receive the argument “msg”. What is this ? for example `RED.log.log (msg) or RED.util.getMessageProperty (msg, expr)`

Thank you and sorry for so many questions.

---

<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:** [13 May 2018 21:23 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/4 "2018-05-13T21:23:55Z")

</div>

The runtime API is not really supported at this level of detail. We're working on a new api that will be properly supported in a future release

> From the runtime-api I can not read variables or messages?

No

> Could I read fields or values of nodes from runtime-api ?

The runtime API does let you access nodes - from there it depends on the individual nodes as to what they expose in a way you can access.

> When you talk about creating a pair of nodes, would they be nodes that speak directly with node.js?

They would be nodes that you are able to access without having to go via the runtime api.

> In the documentation, some functions receive the argument “msg”. What is this ? for example RED.log.log (msg) or RED.util.getMessageProperty (msg, expr)

To be clear, there is no formal documentation of the runtime API. I can't stress this enough.

But, in general `msg` is a message object being passed through a flow.

---

<div class="post-metadata">

**Author:** ![selo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selo/32/1236_2.png) [@selo](https://discourse.nodered.org/u/selo)\
**Post date:** [13 May 2018 21:45 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/5 "2018-05-13T21:45:54Z")

</div>

Thanks, everything cleared.

---

<div class="post-metadata">

**Author:** ![shwetha](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@shwetha](https://discourse.nodered.org/u/shwetha)\
**Post date:** [12 October 2018 07:13 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/6 "2018-10-12T07:13:42Z")

</div>

Hi,

Can you please help me to embed NR nodes into existing Application?  
we have requirement where we need NR nodes to be embed into our existing application, so it would be great help if you can help me on this.

Thanks in advance

---

<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:** [12 October 2018 07:23 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/7 "2018-10-12T07:23:07Z")

</div>

Adding a generic “help me” post to a very old post that has been marked resolved isn’t very useful.  
Please open a new issue, with a specific issue after having read the relevant documentation on the website.

---

<div class="post-metadata">

**Author:** ![shwetha](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@shwetha](https://discourse.nodered.org/u/shwetha)\
**Post date:** [12 October 2018 08:00 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/8 "2018-10-12T08:00:45Z")

</div>

Hi ukmoose,

Thanks for you input, actually I have raised an issue "[Can any one help on embedding node-red in java process](https://discourse.nodered.org/t/can-any-one-help-on-embedding-node-red-in-java-process/3856)" 2 days back but did not get any response.  
So i was going through all the topics and found this one is just related to my query.

If any one can help me to figure out whether it is possible or not that would be great help.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![selo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selo/32/1236_2.png) [@selo](https://discourse.nodered.org/u/selo)\
**Post date:** [12 October 2018 09:24 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/9 "2018-10-12T09:24:27Z")

</div>

Hi,  
this is the official documentation to embed NR in another application Node.js  
[https://nodered.org/docs/embedding](https://nodered.org/docs/embedding)  
I hope it helps you.

---

<div class="post-metadata">

**Author:** ![selo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/selo/32/1236_2.png) [@selo](https://discourse.nodered.org/u/selo)\
**Post date:** [17 October 2018 14:09 UTC](https://discourse.nodered.org/t/help-with-runtime-api/147/10 "2018-10-17T14:09:00Z")

</div>

Hello,  
so as not to duplicate, we can continue the other conversation and close this one.  
regards
