I have a working example of how to do it and that works.
I then applied this structure to a real flow and it threw a wobbly when a message went through.
(I'm not sure how good this capture of the error is)
{"message":"timeout","source":{"id":"622d91911b9a4889","type":"link call","count":1}}
This is an exert from the real code - which has testing nodes still there.
[{"id":"bef2feb18f00fe84","type":"fan","z":"9b0812dc9a773b4e","name":"","x":105,"y":230,"wires":[["7a4c3333f48d6deb"]],"l":false},{"id":"93bcb6e9de127901","type":"inject","z":"9b0812dc9a773b4e","name":"Block me","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Block","payloadType":"str","x":150,"y":140,"wires":[["bef2feb18f00fe84"]]},{"id":"7889e2861e473050","type":"inject","z":"9b0812dc9a773b4e","name":"Other messages","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":170,"y":100,"wires":[["bef2feb18f00fe84"]]},{"id":"7a4c3333f48d6deb","type":"switch","z":"9b0812dc9a773b4e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"GPS","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":195,"y":230,"wires":[["ed58ace4b1421fdb"],["df73549273bf33d6"]],"l":false},{"id":"80770c7ed7a033f9","type":"inject","z":"9b0812dc9a773b4e","name":"Pass","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"pass","payloadType":"str","x":340,"y":50,"wires":[["7681ee6b20ebc897"]]},{"id":"171c8b6bc5ef5c41","type":"inject","z":"9b0812dc9a773b4e","name":"Block","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"block","payloadType":"str","x":340,"y":90,"wires":[["7681ee6b20ebc897"]]},{"id":"7681ee6b20ebc897","type":"change","z":"9b0812dc9a773b4e","name":"","rules":[{"t":"set","p":"A","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":70,"wires":[[]]},{"id":"df73549273bf33d6","type":"switch","z":"9b0812dc9a773b4e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Others","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":455,"y":230,"wires":[["af53bd8c6f4cbd8d"],["dbf0b85a2155c74c"]],"l":false},{"id":"ed58ace4b1421fdb","type":"switch","z":"9b0812dc9a773b4e","name":"A","property":"A","propertyType":"flow","rules":[{"t":"eq","v":"pass","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":190,"wires":[["df73549273bf33d6"]]},{"id":"af53bd8c6f4cbd8d","type":"switch","z":"9b0812dc9a773b4e","name":"B","property":"B","propertyType":"flow","rules":[{"t":"eq","v":"pass","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":560,"y":190,"wires":[["dbf0b85a2155c74c"]]},{"id":"5e3bd07ef350e96d","type":"link in","z":"9b0812dc9a773b4e","name":"SOM EOM Filter IN","links":[],"x":120,"y":280,"wires":[["bef2feb18f00fe84"]],"l":true}]
The switch
node to detect the message has been changed for the real world application - sorry.
But the mechanics are the same. I hope.
I can't see any problems.
However, while typing this I did notice a possible problem.
This routine is to stop unwanted messages to go through there is not always a guaranteed return.
Could that be a cause - as I did see the word timeout
in the error.
I'm going to change it to link out
and link in
nodes and do it the old way.
(It has to work in real life)
This is the message which will be actually sent:
{"topic":"SOM EOM","qos":0,"retain":false,"_msgid":"fdd66fdac19d3c5c","type":"EOM","origPayload":"GPS comms FAILURE","settings":{"input":"2022-06-09T09:57:45.517Z","input_format":"","input_tz":"Australia/Sydney","output_format":"YYYY-MM-DD HH:mm:ss","output_locale":"en_AU","output_tz":"Australia/Sydney"},"time":"2022-06-09 19:57:45","payload":"GPS comms FAILURE 2022-06-09 19:57:45","_event":"node:1a2a766b.e52f42"}
This is near complete exert from the routine. Connect the link nodes to the nearest nodes.
(Foreign node in my flow)
[{"id":"5e3bd07ef350e96d","type":"link in","z":"9b0812dc9a773b4e","name":"SOM EOM Filter IN","links":[],"x":120,"y":280,"wires":[["bef2feb18f00fe84"]],"l":true},{"id":"7a4c3333f48d6deb","type":"switch","z":"9b0812dc9a773b4e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"GPS","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":195,"y":230,"wires":[["ed58ace4b1421fdb"],["df73549273bf33d6"]],"l":false},{"id":"ed58ace4b1421fdb","type":"switch","z":"9b0812dc9a773b4e","name":"A","property":"A","propertyType":"flow","rules":[{"t":"eq","v":"pass","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":190,"wires":[["df73549273bf33d6"]]},{"id":"df73549273bf33d6","type":"switch","z":"9b0812dc9a773b4e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Others","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":455,"y":230,"wires":[["af53bd8c6f4cbd8d"],["dbf0b85a2155c74c"]],"l":false},{"id":"af53bd8c6f4cbd8d","type":"switch","z":"9b0812dc9a773b4e","name":"B","property":"B","propertyType":"flow","rules":[{"t":"eq","v":"pass","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":560,"y":190,"wires":[["dbf0b85a2155c74c"]]},{"id":"dbf0b85a2155c74c","type":"switch","z":"9b0812dc9a773b4e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Others","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":705,"y":230,"wires":[["2c52157f3270e859"],["a3bd5e6cb9fb31be"]],"l":false},{"id":"2c52157f3270e859","type":"switch","z":"9b0812dc9a773b4e","name":"C","property":"C","propertyType":"flow","rules":[{"t":"eq","v":"pass","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":810,"y":190,"wires":[["a3bd5e6cb9fb31be"]]},{"id":"5f24facfc44d3183","type":"link out","z":"9b0812dc9a773b4e","name":"SOM EOM Filter OUT","mode":"return","links":[],"x":1260,"y":230,"wires":[],"l":true}]
This is the node which is at the other end:
[{"id":"622d91911b9a4889","type":"link call","z":"c56bddee.ca0a18","g":"0d1fddaacb85e8f4","name":"","links":["5e3bd07ef350e96d"],"timeout":"30","x":370,"y":2670,"wires":[["d2ff3778.e82568","d5fa32d101eb2095"]]}]
Is that enough information?