# How to identify which instance of node is this

**URL:** <https://discourse.nodered.org/t/how-to-identify-which-instance-of-node-is-this/20154>\
**Category:** General\
**Created:** [10 January 2020 08:54 UTC](https://discourse.nodered.org/t/how-to-identify-which-instance-of-node-is-this/20154 "2020-01-10T08:54:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kiran/32/27855_2.png) [@kiran](https://discourse.nodered.org/u/kiran)\
**Post date:** [10 January 2020 08:54 UTC](https://discourse.nodered.org/t/how-to-identify-which-instance-of-node-is-this/20154/1 "2020-01-10T08:54:09Z")

</div>

i made one custom node named as "PLC", if after deploying flows there are 5 nodes of PLC is there on flows  
In JS file of PLC node i want to know what is number of current node out of 5

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 January 2020 17:52 UTC](https://discourse.nodered.org/t/how-to-identify-which-instance-of-node-is-this/20154/2 "2020-01-10T17:52:19Z")

</div>

Why?

When inside the node's code, there are several sections.

```auto
// This part is common - all instances share this but nothing here is 
// shared with Node-RED by default

module.exports = fuction(RED) {

   // This is also common to all instances 

   RED.nodes.registerType('nodeName', function(config) {
      // Everything in here is specific to a single instance.
      // you don't need to know the ID of the instance
      // just remember that every variable you create here is actually created once
      // per instance and they will be completely independent from any other instance
   })

   // and here we are back to code that is common across all instances
}

```
