# Keep buffer until

**URL:** <https://discourse.nodered.org/t/keep-buffer-until/50546>\
**Category:** General\
**Created:** [2 September 2021 17:08 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546 "2021-09-02T17:08:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bubugian](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@bubugian](https://discourse.nodered.org/u/bubugian)\
**Post date:** [2 September 2021 17:08 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/1 "2021-09-02T17:08:54Z")

</div>

Hi all,  
sorry again for very basic question: I'm new to NR and I'm trying to force myself to use nodes instead of coding.

I get a http buffer from a camera and I need to pass it to the next nodes (functions and telegram) only when a switch node outputs the value 1.

A sort of 'latch' that keep the message and deliver it only if other input is '1'.

Someone would help me with this simple task ?

Thanks !!

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [2 September 2021 18:12 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/2 "2021-09-02T18:12:17Z")

</div>

Are you wanting to store the data or stop it from sending on and allow it to pass with the switch?

---

<div class="post-metadata">

**Author:** ![bubugian](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@bubugian](https://discourse.nodered.org/u/bubugian)\
**Post date:** [2 September 2021 22:03 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/3 "2021-09-02T22:03:03Z")

</div>

I'd like to store it and, then, to pass when switch output becames 1..

Thanks!

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [3 September 2021 05:49 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/4 "2021-09-03T05:49:20Z")

</div>

[Context](https://nodered.org/docs/user-guide/context) can help here

---

<div class="post-metadata">

**Author:** ![bubugian](https://avatars.discourse-cdn.com/v4/letter/b/258eb7/32.png) [@bubugian](https://discourse.nodered.org/u/bubugian)\
**Post date:** [3 September 2021 21:50 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/5 "2021-09-03T21:50:22Z")

</div>

Bak,  
I use a switch node to set flow.image to msg.payload incoming from http request node and, when I need the image, I reuse switch to set msg.payload to flow.image.

Thanks !

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [3 September 2021 22:13 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/6 "2021-09-03T22:13:15Z")

</div>

@bubugian I suggest you have a look at the [queue-gate](https://flows.nodered.org/node/node-red-contrib-queue-gate) node. Depending on the logic of your flow, either the gating or queueing mode might work 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:** [2 November 2021 22:13 UTC](https://discourse.nodered.org/t/keep-buffer-until/50546/7 "2021-11-02T22:13:23Z")

</div>

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