# Use Rate Limit "one per X" per \*instance\* in a subflow?

**URL:** <https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331>\
**Category:** General\
**Created:** [28 August 2021 17:24 UTC](https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331 "2021-08-28T17:24:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshLaseter](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@JoshLaseter](https://discourse.nodered.org/u/JoshLaseter)\
**Post date:** [28 August 2021 17:24 UTC](https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331/1 "2021-08-28T17:24:34Z")

</div>

I have a subflow that I'm calling twice in one workflow but passing in different environment variables. Within the subflow I've got a section that I'd like to only run once per three hours so I've got a Delay Node with Rate Limit selected. The problem is I want one message to pass through for each subflow instance, but as best I can tell the rate limit is being shared across both instances -- specifically the rate limited section executes for the first subflow but not for the second one.

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

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

Am I misunderstanding what's happening? Is there a way to get this to work so that the rate limit is only per-instance? Is this just the wrong tool for the job?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [28 August 2021 17:43 UTC](https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331/2 "2021-08-28T17:43:05Z")

</div>

Each subflow instance should be independent so should act on their own terms.

---

<div class="post-metadata">

**Author:** ![JoshLaseter](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@JoshLaseter](https://discourse.nodered.org/u/JoshLaseter)\
**Post date:** [28 August 2021 18:04 UTC](https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331/3 "2021-08-28T18:04:05Z")

</div>

That's what I thought, which is why I'm confused by the behavior I'm seeing. I guess I'll have to try to debug some more. 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:** [27 October 2021 18:04 UTC](https://discourse.nodered.org/t/use-rate-limit-one-per-x-per-instance-in-a-subflow/50331/4 "2021-10-27T18:04:45Z")

</div>

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