# Cancelling a trigger node, if input changes

**URL:** <https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553>\
**Category:** General\
**Created:** [17 August 2022 13:05 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553 "2022-08-17T13:05:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JHScen](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JHScen](https://discourse.nodered.org/u/JHScen)\
**Post date:** [17 August 2022 13:05 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553/1 "2022-08-17T13:05:18Z")

</div>

I am sending data from an inject node through a filter node (so its only sent through again if the data changes) to a trigger node.

Once it reaches the trigger node, it instantly sends one bit of data to a database.

10 seconds later, another message is sent to the database.

Is it possible to cancel the trigger node part way through? If the initial input changes?

So if 0 is sent by the inject, the filter will send 'hello' followed up by 'world', 10 seconds after.

If 1 is sent by the inject, the filter will send 'testing' followed up by 'theory', 10 seconds after.

Is it possible for 0 to be injected, then after the first message, 'hello' is sent, 1 is injected, so instead of 'world' it would go to 'testing', 'theory'.

Hope my explanation makes sense.

Thanks in advance

 ![Screenshot 2022-08-17 at 13.58.26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/97542beb019fa5aa169f7100fa8c8afec8f7e29c.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [17 August 2022 13:48 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553/2 "2022-08-17T13:48:48Z")

</div>

> [@JHScen](#):
>
> Is it possible to cancel the trigger node part way through?

From the help for the trigger node:

> If the node receives a message with a `reset` property, or a `payload` that matches that configured in the node, any timeout or repeat currently in progress will be cleared and no message triggered.

This might work, though I don't like the look of the 5 second delay node.

 ![Untitled 5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d96c30e873a4ad8b89d75271a4e365c7acb6a3eb.jpeg)

---

<div class="post-metadata">

**Author:** ![JHScen](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JHScen](https://discourse.nodered.org/u/JHScen)\
**Post date:** [17 August 2022 14:39 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553/3 "2022-08-17T14:39:58Z")

</div>

I'm not sure it works - unless what I have put inside my msg.reset doesn't match what you have?

---

<div class="post-metadata">

**Author:** ![JHScen](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@JHScen](https://discourse.nodered.org/u/JHScen)\
**Post date:** [17 August 2022 14:49 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553/4 "2022-08-17T14:49:21Z")

</div>

However, it works if I move the msg.reset to connect straight to the inject nodes! So thanks!!

---

<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:** [31 August 2022 14:49 UTC](https://discourse.nodered.org/t/cancelling-a-trigger-node-if-input-changes/66553/5 "2022-08-31T14:49:51Z")

</div>

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