# Drop incoming messages after first message reac

**URL:** https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846
**Category:** General
**Created:** [28 December 2022 17:11 UTC](https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846 "2022-12-28T17:11:04Z")
**Posts on this page:** 4
**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: [28 December 2022 17:11 UTC](https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846/1 "2022-12-28T17:11:04Z")

</div>

Is there some straightforward way to allow only the first message and drop subsequent messages and continue doing so until the first message has reached the end of the flow, and then repeat the same.

In this particular application Node Ren runs two python scripts.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/435cc77269f8843505c7df80ee6403d8a47d2777.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [28 December 2022 17:20 UTC](https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846/2 "2022-12-28T17:20:30Z")

</div>

The trigger node will do what you require  
e,g,

```auto
[{"id":"511279040ece5903","type":"inject","z":"da8a6ef0b3c9a5c8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1160,"wires":[["930ea86c5fde848e"]]},{"id":"930ea86c5fde848e","type":"trigger","z":"da8a6ef0b3c9a5c8","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":360,"y":1160,"wires":[["0aa962d61db9c679"]]},{"id":"94b693dd48209d51","type":"change","z":"da8a6ef0b3c9a5c8","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1240,"wires":[["930ea86c5fde848e"]]},{"id":"0aa962d61db9c679","type":"delay","z":"da8a6ef0b3c9a5c8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":540,"y":1160,"wires":[["217e27fd051a937f","94b693dd48209d51"]]},{"id":"217e27fd051a937f","type":"debug","z":"da8a6ef0b3c9a5c8","name":"debug 118","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":1160,"wires":[]}]

```

---

<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: [29 December 2022 12:59 UTC](https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846/3 "2022-12-29T12:59:29Z")

</div>

Many thanks, this was exactlyt what I was missing! End result is as follows, as per your suggestion.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e952470325bf68a7091c56852132e465fdb92ea5.png)

---

<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: [12 January 2023 13:00 UTC](https://discourse.nodered.org/t/drop-incoming-messages-after-first-message-reac/72846/4 "2023-01-12T13:00:06Z")

</div>

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