Within Node-RED, we have the ability to create custom nodes. These perform specific work that is not supplied by the out-of-the-box pre-supplied nodes. There are many community provided instances of these. A custom node may wish to handle some new form of input event. Let us imagine that we have a new network technology called 2TinCans (2 tin cans connected by a piece of string). If we wish to handle a request/response using this, we might create two new Node-RED nodes ... one to handle input (the request) and one to handle the output (the response). When a request arrives, the 2TinCans server running in Node-RED is already listening for incoming requests. When the request is received, the node sends a new message down-stream. Eventually, this will reach a 2TinCans response node which is responsible for sending back the response to the corresponding original request.
Here is where the question comes in ... how do we maintain the "state" of this conversation such that the responding node knows to send the response to the correct partner?