# 0 input and not go to the next node

**URL:** <https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868>\
**Category:** Developing Nodes\
**Created:** [14 September 2020 12:17 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868 "2020-09-14T12:17:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![techno-blogger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/techno-blogger/32/28582_2.png) [@techno-blogger](https://discourse.nodered.org/u/techno-blogger)\
**Post date:** [14 September 2020 12:17 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/1 "2020-09-14T12:17:46Z")

</div>

Hello,  
I want to create a function with 0 input and 1 output. I've done the HTML code and the JS code, the code runs fine but does not go to the next node.  
Can you help me solve my problem

HTML

```auto

<!-- ***************FONCTION test MAIL*************** -->
<script type="text/javascript">
  RED.nodes.registerType('ews-monTest', {
    category: 'EWS',
    color: '#2684ff',
    defaults: {
      name: {
        value: ""
      }
    },  
    inputs: 0,
    outputs: 1,
    icon: "ews-icon.png",
    label: function() {
      return this.name || "ews-monTest";
    }
  });
</script>
<script type="text/x-red" data-template-name="ews-monTest">
  <div class="form-row">
    <label for="node-input-name"><i class="icon-tag"></i> Name</label>
    <input type="text" id="node-input-name" placeholder="Name"/>
  </div>
</script>

<script type="text/x-red" data-help-name="ews-monTest">
    <p>Mon test</p>
</script>

```

JS

```auto
module.exports = function(RED) {
    "use strict";

    / ************************************************************************************
    * ewsMonTest
    ************************************************************************************ /
    function ewsMonTest(config) {
        console.log("ewsMonTest => ---------------- TEST -------------------");
        RED.nodes.createNode(this,config);
        var node = this;
           var msg = {"payload":"bla"}
           node.send(msg);
           node.send(msg);
        
    }
         	RED.nodes.registerType("ews-monTest", ewsMonTest);
}

```

RESULT

```auto
14 Sep 13:54:11 - [info] Starting flows
ewsMonTest => ---------------- TEST -------------------
14 Sep 13:54:12 - [info] Started flows

```

cordially

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 September 2020 12:26 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/2 "2020-09-14T12:26:57Z")

</div>

That looks like it should send two msg... but... it will do so as soon as the node is created - which may well be before any other nodes are up and ready to listen to it.

---

<div class="post-metadata">

**Author:** ![techno-blogger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/techno-blogger/32/28582_2.png) [@techno-blogger](https://discourse.nodered.org/u/techno-blogger)\
**Post date:** [14 September 2020 12:36 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/3 "2020-09-14T12:36:23Z")

</div>

> [@dceejay](#):
>
> That looks like it should send two msg... but... it will do so as soon as the node is created - which may well be before any other nodes are up and ready to listen to it

I changed my code and it's OK

```auto
function ewsMonTest(config) {   
        console.log("ewsMonTest => ---------------- TEST -------------------");
        RED.nodes.createNode(this,config);
        var node = this;
        var msg = {"payload":"bla"}

        setTimeout(function(){ 
            console.log("ewsMonTest => send");
            node.send(msg); 
        }, 5000);          
        
    }

```

I am going to re-test with my complete notification handling code and I hope it will work. thank you so much

---

<div class="post-metadata">

**Author:** ![techno-blogger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/techno-blogger/32/28582_2.png) [@techno-blogger](https://discourse.nodered.org/u/techno-blogger)\
**Post date:** [14 September 2020 12:54 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/4 "2020-09-14T12:54:46Z")

</div>

how can we make the code run only when the flow is started ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 September 2020 14:08 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/5 "2020-09-14T14:08:39Z")

</div>

You already are. ? The flow is running. Or do you mean something else....

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 November 2020 14:08 UTC](https://discourse.nodered.org/t/0-input-and-not-go-to-the-next-node/32868/6 "2020-11-13T14:08:45Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
