# Runtime api deploy

**URL:** <https://discourse.nodered.org/t/runtime-api-deploy/2090>\
**Category:** General\
**Created:** [6 August 2018 08:49 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090 "2018-08-06T08:49:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CatalinFetoiu](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@CatalinFetoiu](https://discourse.nodered.org/u/CatalinFetoiu)\
**Post date:** [6 August 2018 08:49 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090/1 "2018-08-06T08:49:13Z")

</div>

Hello,

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?

Thanks!

---

<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:** [6 August 2018 20:15 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090/2 "2018-08-06T20:15:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CatalinFetoiu](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@CatalinFetoiu](https://discourse.nodered.org/u/CatalinFetoiu)\
**Post date:** [6 August 2018 20:42 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090/3 "2018-08-06T20:42:37Z")

</div>

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.

Thanks!

lun., 6 aug. 2018, 23:25 Colin [nodered@discoursemail.com](mailto:nodered@discoursemail.com) a scris:

---

<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:** [6 August 2018 21:31 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090/4 "2018-08-06T21:31:00Z")

</div>

@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 `RED.events` event emitter.

---

<div class="post-metadata">

**Author:** ![CatalinFetoiu](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@CatalinFetoiu](https://discourse.nodered.org/u/CatalinFetoiu)\
**Post date:** [8 August 2018 11:48 UTC](https://discourse.nodered.org/t/runtime-api-deploy/2090/5 "2018-08-08T11:48:10Z")

</div>

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

Catalin
