Runtime api deploy



Is there a way to use the runtime api in order to get a callback when a flow is deployed? Or how can I know when to call getFlows() and obtain a non-null result?



Perhaps I misunderstand the requirement, but if you configure an inject to once on startup then that will trigger when the flow is deployed, so you can make it do whatever you like then.


Can you give a little snippet please? because I cannot find an inject function in the runtime api, altough I may have seen something related online.


lun., 6 aug. 2018, 23:25 Colin a scris:


@CatalinFetoiu Colin's suggestion was to use an Inject node in the flow you have configured to run in Node-RED. It is not part of the runtime api.

We do not have a formally documented runtime api yet - what is there today will be deprecated in the near future and some migration work will be needed in the run up to our 1.0 release.

With the current code, you can listen for the nodes-started event on the event emitter.


Thank you for the response! It worked using the nodes-started event.