# Creating nodes: how to execute code?

**URL:** <https://discourse.nodered.org/t/creating-nodes-how-to-execute-code/67789>\
**Category:** General\
**Created:** [16 September 2022 07:31 UTC](https://discourse.nodered.org/t/creating-nodes-how-to-execute-code/67789 "2022-09-16T07:31:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnusso](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/magnusso/32/37680_2.png) [@magnusso](https://discourse.nodered.org/u/magnusso)\
**Post date:** [16 September 2022 07:31 UTC](https://discourse.nodered.org/t/creating-nodes-how-to-execute-code/67789/1 "2022-09-16T07:31:50Z")

</div>

Could you please point me in the right direction. How does one create a simple timer? Initially a light is turned off by the press of a button, which initiates message. After 5 minutes has passed, how do you initiate a turn-off message?

---

<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:** [16 September 2022 07:46 UTC](https://discourse.nodered.org/t/creating-nodes-how-to-execute-code/67789/2 "2022-09-16T07:46:08Z")

</div>

Have a look at the trigger node, which can do that for you.

---

<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:** [30 September 2022 07:46 UTC](https://discourse.nodered.org/t/creating-nodes-how-to-execute-code/67789/3 "2022-09-30T07:46:48Z")

</div>

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