# Autostart node on deploy

**URL:** <https://discourse.nodered.org/t/autostart-node-on-deploy/16541>\
**Category:** General\
**Created:** [10 October 2019 10:45 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541 "2019-10-10T10:45:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![francxk](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@francxk](https://discourse.nodered.org/u/francxk)\
**Post date:** [10 October 2019 10:45 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/1 "2019-10-10T10:45:44Z")

</div>

Hello,

is it possible to autostart a function (`function node`) or when writing a new node sending automatically a message on deploy event ?

Is can be an invisible `inject` feature

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 October 2019 11:20 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/2 "2019-10-10T11:20:58Z")

</div>

I don't know if it can be done in a function node but you can do it if your writing your own node - the node-red-contrib-config does it

I think its the marked bit of code but not totally sure

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c5f6aed1a57c7d4856030b4ebd8e3e94e9a8f214.png)

Why the need for an invisible inject?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [10 October 2019 11:52 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/3 "2019-10-10T11:52:09Z")

</div>

![38](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/32e2c16232be58cd6c1a4ba09d9f17a35a229c6e.png)   
Will the "inject once" button work for your use case?

---

<div class="post-metadata">

**Author:** ![francxk](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@francxk](https://discourse.nodered.org/u/francxk)\
**Post date:** [10 October 2019 12:01 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/4 "2019-10-10T12:01:10Z")

</div>

the `inject once` feature implies a very visible and not to foget node, it what try to avoid...  
Thx

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 October 2019 12:31 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/5 "2019-10-10T12:31:19Z")

</div>

You can make it smaller or even hide it underneath 🙂

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/af3499817824e51392c9dc28ffee063f40e5502b.png)

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [10 October 2019 16:21 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/6 "2019-10-10T16:21:25Z")

</div>

Is there a specific reason why you want it to be invisible? With it invisible in the editor it might be harder to maintain on the longer term, but if it is inside a custom node you can document it easier. For maintenance that might be your best solution

---

<div class="post-metadata">

**Author:** ![francxk](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@francxk](https://discourse.nodered.org/u/francxk)\
**Post date:** [11 October 2019 10:35 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/7 "2019-10-11T10:35:50Z")

</div>

visible is not the right word in fact. I want to spontaneously generate event at startup of a flow.

---

<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:** [11 October 2019 10:47 UTC](https://discourse.nodered.org/t/autostart-node-on-deploy/16541/8 "2019-10-11T10:47:31Z")

</div>

What _exactly_ do you mean by "startup of a flow".
