# Node-red merging multiple tasks

**URL:** https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308
**Category:** General
**Tags:** node-red-dashboard, function-node
**Created:** [9 November 2022 08:55 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308 "2022-11-09T08:55:57Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 November 2022 11:41 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/22 "2022-11-10T11:41:41Z")

</div>

Did you have more than one configuration file? If so you could have each button node connect send the file name to the file-in node

---

<div class="post-metadata">

### Author: ![cano](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cano](https://discourse.nodered.org/u/cano)
#### Post date: [10 November 2022 11:43 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/23 "2022-11-10T11:43:36Z")

</div>

no, my main goal is to create them all in a single node and a single file, I'll just add 3 buttons and give separate tasks 🙄

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 November 2022 12:11 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/24 "2022-11-10T12:11:48Z")

</div>

> [@cano](#):
>
> main goal is to create them all in a single node and a single file

So you have lost me again. What do you want to create in a single node? Which of the nodes in your flow do you mean?

---

<div class="post-metadata">

### Author: ![cano](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cano](https://discourse.nodered.org/u/cano)
#### Post date: [10 November 2022 12:17 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/26 "2022-11-10T12:17:07Z")

</div>

As in the example, I will have 3 buttons, and whichever button I press will trigger the task in it

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 November 2022 12:18 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/27 "2022-11-10T12:18:14Z")

</div>

I asked `What do you want to create in a single node?` and you responded with your entire flow. So are you saying you want to put that all in a single node?

If not, then what do you mean?

---

<div class="post-metadata">

### Author: ![cano](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cano](https://discourse.nodered.org/u/cano)
#### Post date: [10 November 2022 12:19 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/28 "2022-11-10T12:19:52Z")

</div>

yes I want to collect them all in one node

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [10 November 2022 12:27 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/29 "2022-11-10T12:27:44Z")

</div>

Why? That pretty much defeats the purpose of NR. But if that is what you want to do, have a go at it, but I'm not going to be able to help you out.

Good Luck!

---

<div class="post-metadata">

### Author: ![piwi447](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/piwi447/32/67335_2.png) [@piwi447](https://discourse.nodered.org/u/piwi447)
#### Post date: [11 November 2022 08:44 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/31 "2022-11-11T08:44:21Z")

</div>

Hello,  
I think there is confusion between flow and node.  
My understanding is the following :  
You want that the link between the button number and the task to be coded in a YAML file to avoid to change the nodered code when you want to change the task.  
So basically you should load the file and convert it into and array of object that you store in global context each time the file is changed  
Then you just need to send a index from 1 to 3 in the uI button.  
This will trigger a function node or change node that with select the right task in the array and send it to the robot using API …  
One flow combining all UI buttons into one function node should work  
Hope it clarify

Pierre RUWET

---

<div class="post-metadata">

### Author: ![cano](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cano](https://discourse.nodered.org/u/cano)
#### Post date: [12 November 2022 09:42 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/32 "2022-11-12T09:42:51Z")

</div>

thank you for your help but I would be very glad if you show it with a sample flow

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [12 November 2022 09:51 UTC](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308/33 "2022-11-12T09:51:23Z")

</div>

The best way to leard is to try, so give it a try and if you have a problem, export your flow and attach it to a reply and explaing where you are having a problem. (If you are unsure how to post code, go back and read the third post in this thread where I gave you information on how to do it)

`debug` nodes are very useful in seeing what is going on in a flow. I use them alot while developing flows and them remove them when I get things to work.

[Previous page](https://discourse.nodered.org/t/node-red-merging-multiple-tasks/70308.md?page=1)
