# How to set the trigger frequency based on context value

**URL:** <https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224>\
**Category:** General\
**Created:** [23 May 2025 07:55 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224 "2025-05-23T07:55:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijayaprabu](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vijayaprabu](https://discourse.nodered.org/u/vijayaprabu)\
**Post date:** [23 May 2025 07:55 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/1 "2025-05-23T07:55:53Z")

</div>

I have to respond based on a regular interval which is part of request. can you suggest

---

<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:** [23 May 2025 08:04 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/2 "2025-05-23T08:04:50Z")

</div>

Welcome to the forum @vijayaprabu

You are going to have to give us a lot more information than that before we can give you any sensible suggestions.

---

<div class="post-metadata">

**Author:** ![vijayaprabu](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vijayaprabu](https://discourse.nodered.org/u/vijayaprabu)\
**Post date:** [23 May 2025 09:40 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/3 "2025-05-23T09:40:17Z")

</div>

Hi @jbudd

i have a client which request a data on request. in the request its mentioned that in what interval the data has to be sent till the request is revoked. i have seen the [Trigger a flow at regular intervals : Node-RED](https://cookbook.nodered.org/basic/trigger-at-interval) and [Route or block a message based on a context value : Node-RED](https://cookbook.nodered.org/basic/route-on-context). what i am looking is like set the interval based on the context from the request

---

<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:** [23 May 2025 09:54 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/4 "2025-05-23T09:54:14Z")

</div>

Try the cron-plus contrib node.

You can use the request to specify or cancel a schedule of times to inject data to the flow.

---

<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:** [23 May 2025 10:24 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/5 "2025-05-23T10:24:36Z")

</div>

A possibly simpler way is to use a Change node to move the required interval (in milliseconds) into `msg.delay` then feed that into a Trigger node configured like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35b05335143889951016275c3a22d88660292e3b.png)

That will pass the message on and then send it again at the interval specified in `msg.delay`. The 10 seconds specified is ignored because `override delay` is ticked.  
When you get the revoke instruction then then send the Trigger node a message containing just `msg.reset` set to `true` and it will stop sending.

---

<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:** [21 August 2025 10:24 UTC](https://discourse.nodered.org/t/how-to-set-the-trigger-frequency-based-on-context-value/97224/6 "2025-08-21T10:24:52Z")

</div>

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