I have run into a bit of a problem where I'm trying to wait on two things to complete before I move to the next step in a sequential process. Ordinarily a join node would work, with both inputs fed in and set the node to trigger once a set number of inputs are received.
My problem is that one of the inputs is an MQTT topic, which is published to multiple times in the same flow. That means that only the first join node in the sequence works as intended.
What's the best way to implement this so that it works as planned? Is there a way to wait for one input first to then poll for the MQTT packet?
Example flow:
[{"id":"809f81b8.4f989","type":"link in","z":"4ffa72da.fb000c","name":"Start trigger","links":[],"x":410,"y":1120,"wires":[["f190634d.26ab7"]],"l":true},{"id":"f190634d.26ab7","type":"change","z":"4ffa72da.fb000c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"collection_zPos","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1120,"wires":[["bc14c79a.7a26e8","5acdad32.a1f1e4"]]},{"id":"bc14c79a.7a26e8","type":"mqtt out","z":"4ffa72da.fb000c","name":"","topic":"MQTT/action","qos":"","retain":"","broker":"4d04db7.06a6024","x":810,"y":1120,"wires":[]},{"id":"7e275467.c9855c","type":"mqtt in","z":"4ffa72da.fb000c","name":"","topic":"MQTT/action/complete","qos":"2","datatype":"auto","broker":"4d04db7.06a6024","x":580,"y":1180,"wires":[["5acdad32.a1f1e4"]]},{"id":"5acdad32.a1f1e4","type":"join","z":"4ffa72da.fb000c","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":1180,"wires":[["91f9a5c.e1c3358","df79de77.90f6e"]]},{"id":"91f9a5c.e1c3358","type":"delay","z":"4ffa72da.fb000c","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":950,"y":1240,"wires":[["e093f84d.6b3008"]]},{"id":"e093f84d.6b3008","type":"change","z":"4ffa72da.fb000c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"collection_xPos","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1240,"wires":[["eb2d1c08.b90a5","4a52cb3.b8f3f34"]]},{"id":"eb2d1c08.b90a5","type":"join","z":"4ffa72da.fb000c","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1330,"y":1300,"wires":[["40ed58ea.3213b8"]]},{"id":"df79de77.90f6e","type":"link out","z":"4ffa72da.fb000c","name":"Internal action","links":[],"x":960,"y":1180,"wires":[],"l":true},{"id":"40ed58ea.3213b8","type":"link out","z":"4ffa72da.fb000c","name":"process complete","links":[],"x":1510,"y":1300,"wires":[],"l":true},{"id":"4a52cb3.b8f3f34","type":"mqtt out","z":"4ffa72da.fb000c","name":"","topic":"MQTT/action","qos":"","retain":"","broker":"4d04db7.06a6024","x":1350,"y":1240,"wires":[]},{"id":"eeb11b10.896968","type":"mqtt in","z":"4ffa72da.fb000c","name":"","topic":"MQTT/action/complete","qos":"2","datatype":"auto","broker":"4d04db7.06a6024","x":1120,"y":1300,"wires":[["eb2d1c08.b90a5"]]},{"id":"4d04db7.06a6024","type":"mqtt-broker","name":"Mosquitto localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]