Node-red merging multiple tasks

Hello, I will have 3 buttons on node-red and in a yaml file I will create from visual studio, which button I press will trigger the task in that button, how can I do it?

@cano welcome to the forum!

When asking for help, it is a good idea to suppl some detail about your issue. Take a moment to ask yourself "If I wasn't the one doing this progect, would I be able to understand what the question is?"

so are the buttons in node-red and the yaml file or do you have three buttons in NR and three buttons in a yaml file?
What does the yaml file have to do with this?
What have you tried so far (providing an simplified example flow makes it easy for others to help)
What version of NR and node.js are you running? (see the startup log)

These are just some of the information I would need to to help you out.

Remember, none of us on the forum are paid, so it helps to save the time of the people who you want help from. :grinning:

I have 3 buttons on node-red, and whichever of these buttons I press will trigger the task behind it, for example, when I click on the first button, it will write test 1, but while doing this, config without using any function on the flow.i will create a yaml file and write my transactions in it

and what about these two?

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

   code goes here 

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

Node.js v16.17.0. i'm using it and I don't think it's related to the node version, what I want to do is very simple, I want to put 3 buttons and assign tasks to these buttons, and while I'm doing this, I want to open a config file with vs code and define the buttons and print the task, but I can't ;D

A button node outputs a msg that is sent to other nodes via a wire connecting the nodes. So what kind of tasks do you want to the buttons to do?

Since you seem to be new to Node-RED, I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

I'm working on coding and robotics company, for example when I press button 1 button 2 button 3. start moving the robot's lights will blink when I press E to pressure the robot, the robot will stop and that will be the shape, but make the task all of the buttons individually to give a single config file into this file and I want the button to change the value of tasks I should write

Again I do not understand what you have written. What button does what?
Can you please explain this step by step, for example

  1. press button 1
  2. start robot motor and blink lights
  3. after 10 seconds stop motor

Button 1: Change the lights around the robot
Button 2: Make the robot move
Button 3: Make the robot wait 3 seconds
The content of the buttons will be this way, and whichever button I press will perform that task, but while doing this, as I said, it will be in the config file that I will create from visual studio code

So how do you send the information to the robot?

You are building a config file that contains the commands for the robot, you will have to have a way to send that file to the robot.

In Node-RED you could use a file-in node to read the config file but now you have to send it to the robot. How will you communicate with the robot?

i can establish communication with the robot via the api key, I have no problems on the robot side, it takes my tasks properly with a single button, but I can't define tasks separately on 3 buttons

Please export your current flow and attach it to a reply

Please fix your flow.json post. you need to post it between tripple backticks, use the </> button. It is corrupt because not posted correctly.

Also what does C:\Users\canoz\.node-red\config.yaml look like.

i have also fixed it, the inside of the file path will become interactive with the button by creating a config, as I said above, to the contents of the currently empty file path

When you use the word 'button' are you referencing the editor's inject node, or a ui-button node in the dashboard?

ui button

Does your flow work when you press the inject button?

If so, add a ui-button to the flow and attach it ti the function node where the inject node is connected.

yes, inject works, but what I want is that there are 3 ui-buttons instead of inject, and each of the buttons triggers a different task

Then create three flows accessing different configuration files

can't i combine them all in one stream because where i work wanted something like this