# Merge data from multiple threads

**URL:** <https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187>\
**Category:** General\
**Created:** [17 July 2025 20:11 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187 "2025-07-17T20:11:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ksum/32/78579_2.png) [@KSum](https://discourse.nodered.org/u/KSum)\
**Post date:** [17 July 2025 20:11 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187/1 "2025-07-17T20:11:39Z")

</div>

I have need to collect the value of multiple datapoints and use them as a group. For a simplified example, I have X/Y points and want to graph them. But my data coming in is individual items. Each X value comes in and each Y value comes in via separate flow messages. The problem is that I may get multiple X values and the Y value may not change for an unknown period of time and is not reported at the same time. I need to send both values as a pair when an updated value is received. This is a simplified version of what I am after. I am wonder what my options are as I do not believe a Join node will work.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 July 2025 20:25 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187/2 "2025-07-17T20:25:28Z")

</div>

The join node is the right choice.

Set it to manual mode, leave everything default apart from entering 2 for the count field and ticking the checkbox for sending subsequent messages.

The key to making this work is ensuring that the input data has a valid topic. In your case the x value should have a topic of x and the y value should have a topic of y. If your data does not have a topic, you can simply add a topic using a change node before the join.

See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

---

<div class="post-metadata">

**Author:** ![KSum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ksum/32/78579_2.png) [@KSum](https://discourse.nodered.org/u/KSum)\
**Post date:** [17 July 2025 21:39 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187/3 "2025-07-17T21:39:44Z")

</div>

Thank you, Steve. I thought I had tested this and was not getting what I wanted. Perhaps I had not checked the _subsequent message_ option. I did misread the recipe where it states. "As we know there are three separate streams of messages to join, the node has been to configure to send on a message when it receives that number of parts." to mean that it needed to get 1 part from each and somehow missed the next paragraph. Reading it again, one might argue that perhaps that next paragraph should not be a second paragraph.

---

<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:** [18 July 2025 08:12 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187/4 "2025-07-18T08:12:34Z")

</div>

> [@KSum](#):
>
> Perhaps I had not checked the _subsequent message_ option.

Just to note that when you have that checked you can determine which message has just been received by looking at msg.topic.

---

<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:** [1 August 2025 08:12 UTC](https://discourse.nodered.org/t/merge-data-from-multiple-threads/98187/5 "2025-08-01T08:12:36Z")

</div>

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