# Event for node paste/import

**URL:** <https://discourse.nodered.org/t/event-for-node-paste-import/3644>\
**Category:** Developing Nodes\
**Created:** [3 October 2018 01:25 UTC](https://discourse.nodered.org/t/event-for-node-paste-import/3644 "2018-10-03T01:25:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uma](https://avatars.discourse-cdn.com/v4/letter/u/ba9def/32.png) [@uma](https://discourse.nodered.org/u/uma)\
**Post date:** [3 October 2018 01:25 UTC](https://discourse.nodered.org/t/event-for-node-paste-import/3644/1 "2018-10-03T01:25:16Z")

</div>

Hi  
Is there an event I can listen on to be notified when a node is copy/pasted or imported? I am looking for something similar to node.on("close", function (){...

Something like node.on("paste", function (){...

I have verified that the constructor does not get called in the above scenario- so I cant use that.

Thanks  
Uma

---

<div class="post-metadata">

**Author:** ![uma](https://avatars.discourse-cdn.com/v4/letter/u/ba9def/32.png) [@uma](https://discourse.nodered.org/u/uma)\
**Post date:** [16 October 2018 05:35 UTC](https://discourse.nodered.org/t/event-for-node-paste-import/3644/2 "2018-10-16T05:35:45Z")

</div>

Never mind- I worked around it by adding my code in the constructor

---

<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:** [16 October 2018 07:34 UTC](https://discourse.nodered.org/t/event-for-node-paste-import/3644/3 "2018-10-16T07:34:41Z")

</div>

Hi @uma - my apologies for missing your original post. Glad to hear you've worked around the issue.

In your original question you are mixing runtime lifecycle of a node with the editor lifecycle of a node.

The runtime doesn't know anything about what is happening in the editor until you click the deploy button and the new flow configuration is passed in.

There are techniques for the editor to send custom api calls back to the runtime to help gather configuration information - for example, the Serial nodes will list the available serial ports in the edit dialog using this method. A basic outline of how that works is available [here](https://stackoverflow.com/questions/41567175/send-data-on-configuration/41567832#41567832).

---

<div class="post-metadata">

**Author:** ![uma](https://avatars.discourse-cdn.com/v4/letter/u/ba9def/32.png) [@uma](https://discourse.nodered.org/u/uma)\
**Post date:** [18 October 2018 22:20 UTC](https://discourse.nodered.org/t/event-for-node-paste-import/3644/4 "2018-10-18T22:20:07Z")

</div>

Thanks a bunch for this Nick- I find the capability to make calls to the runtime from the editor very convenient indeed. Kudos for having developed this feature 🙂
