How to call Node-red flow from Java

#1

Do you guys have any idea about how to call Node-red particular flow from Java?
Thanks for the help in advance!

0 Likes

#2

Already answered in slack. You need some sort of event. Usually network based. Choice is up to you…

0 Likes

#3

Hey, I am not getting way how to implement this, I already implemented calling Jar file from node red without using MQTT or HTTP just writing a function node, but I am looking for vice-versa without MQTT or HTTP

0 Likes

#4

What do you mean by calling a flow? Give us an example of what you want to do.

0 Likes

#5

Could you share how you’re doing that?

Note I’ve moved this thread to the #general category - #development is for work on Node-RED itself, not how to use it.

0 Likes

#6

I call a Java jar from the function node with the help of child_process module of node.js. Basically instead of using the cmd I wrote the command in Function node to run the jar file.

0 Likes

#7

Calling a flow means, I have a flow ,for executing the flow each time I need to come in node-red platform and inject that , I want to do that from outside like from console or from any other way.

0 Likes

#8

@somilkhandelwalwork the only way for an external process to trigger a node-red flow is for that node-red flow to be listening for some external event. So you have to decide what mechanism you want to use to trigger that event. Others have listed off the variety of nodes we have for doing that sort of thing. You need to pick which suits your needs.

For running an external process from node-red, there is also the Exec node rather than writing the child_process code yourself.

0 Likes