NodeRed TCP OUT Node Success Response

[quote="Steve-Mcl, post:13, topic:81256, full:true"]
Sorry, that sample flow is not entirely clear what you are expecting to send to MQTT AFTER success/fail.

For example, you have not created a tcp-in -> send_fake_but_valid_data ->tcp-out

I am sending back the exact same request json with additional variables of successCode in case of success and errorcode in case of error. I have added sample response json in function node

Good - ok. I understand that.

If you get a "list of sensors" then how do you "update the sensor"?
What is the relevant parts of the incoming data?
What is the data to be sent to TCP (an exact example please)
Are you expecting the each sensor to go to 1 TCP server or different TCP servers?

1. After getting the request json I am updating the sensor through TCP protocol. I will have predefined tcp nodes and based on sensor id , I will send response to tcp server.
2. I will be sending opValue to tcp server based on sensorId. all parts are relevant and need to send back same request json with success code.
3. opValue
4. Multiple sensor can have same server or multiple. It depends but currently as first step I am trying to update the same tcp server.

What EXACTLY is "the response" a string of "ok" a JS object containing xyz?
please add an example to your demo flow.

TCP server may or maynot send the response. If Server update is successful and I dont get any error, I need the send the same request json with additional parameters succiessCode and ErrorCode in paramList.

**Response JSON**
**{**
**    "sensorList": [**
**        {**
**            "sensorId": "6131a8d409e2162ea1df532e",**
**            "protocol": "tcp",**
**            "paramList": [**
**                {**
**                    "paramName": "voltage",**
**                    "opValue": "220",**
**                    "successCode": "",**
**                    "errorCode": ""**
**                }**
**            ]**
**        },**
**        {**
**            "sensorId": "6131a8d409e2162ea1d423432e",**
**            "protocol": "tcp",**
**            "paramList": [**
**                {**
**                    "paramName": "temp",**
**                    "opValue": "220",**
**                    "successCode": "",**
**                    "errorCode": ""**
**                }**
**            ]**
**        }**
**    ]**
**}**

NOTE: I realise that some of the answers may already be posted in previous posts but I dont want to assume anything.
[/quote]

Thanks for giving your time in understanding and trying to help. I am blocked and needs to get it done asap.