[{"id":"9538fbf50ee36265","type":"inject","z":"5b623fd31ca86a42","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"port1","payload":"pass","payloadType":"str","x":220,"y":375,"wires":[["3d8812f7af908cf9"]]},{"id":"0762f42705ccdb38","type":"inject","z":"5b623fd31ca86a42","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"port1","payload":"fail","payloadType":"str","x":220,"y":425,"wires":[["3d8812f7af908cf9"]]},{"id":"b56e394785ac8b5d","type":"inject","z":"5b623fd31ca86a42","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"port2","payload":"pass","payloadType":"str","x":220,"y":525,"wires":[["9db2f6b675ac27a5"]]},{"id":"b8490bfc0d99dde2","type":"inject","z":"5b623fd31ca86a42","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"port2","payload":"fail","payloadType":"str","x":220,"y":575,"wires":[["9db2f6b675ac27a5"]]},{"id":"3d8812f7af908cf9","type":"switch","z":"5b623fd31ca86a42","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"pass","vt":"str"},{"t":"eq","v":"fail","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":400,"wires":[["b7c48d66bfa85cc9"],["b83e387a399c5ad7"]]},{"id":"b7c48d66bfa85cc9","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"port1","pt":"flow","to":"pass","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":375,"wires":[["ca02c5867bf6fc79"]]},{"id":"b83e387a399c5ad7","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"port1","pt":"flow","to":"fail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":425,"wires":[["ca02c5867bf6fc79"]]},{"id":"9db2f6b675ac27a5","type":"switch","z":"5b623fd31ca86a42","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"pass","vt":"str"},{"t":"eq","v":"fail","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":550,"wires":[["c85f9ce51449306a"],["8ea3c5a55d8dbe02"]]},{"id":"c85f9ce51449306a","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"port2","pt":"flow","to":"pass","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":525,"wires":[["ca02c5867bf6fc79"]]},{"id":"8ea3c5a55d8dbe02","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"port2","pt":"flow","to":"fail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":575,"wires":[["ca02c5867bf6fc79"]]},{"id":"cd5e85b8f91282df","type":"cronplus","z":"5b623fd31ca86a42","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"","defaultLocationType":"default","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":" */450 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":215,"y":700,"wires":[["d42dbf4bce001ef0"]]},{"id":"d42dbf4bce001ef0","type":"switch","z":"5b623fd31ca86a42","name":"PORT1","property":"port1","propertyType":"flow","rules":[{"t":"eq","v":"fail","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":700,"wires":[["664df4889e07b326"]]},{"id":"664df4889e07b326","type":"switch","z":"5b623fd31ca86a42","name":"PORT2","property":"port2","propertyType":"flow","rules":[{"t":"eq","v":"fail","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":560,"y":700,"wires":[["8eb7cb33b75f595c"]]},{"id":"8eb7cb33b75f595c","type":"change","z":"5b623fd31ca86a42","name":"Increment","rules":[{"t":"set","p":"topic","pt":"msg","to":"increment","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":715,"y":700,"wires":[["87cb6dd3a01b9929"]]},{"id":"87cb6dd3a01b9929","type":"function","z":"5b623fd31ca86a42","name":"Counter","func":"var count = context.get('count')||0;\n\nif (msg.topic == \"reset\") {\n count = 0;\n context.set('count',0);\n}\nelse if (msg.topic== \"increment\") {\n count += 1;\n context.set('count',count);\n}\nelse if ( (msg.topic == \"decrement\")) {\n count -= 1;\n context.set('count',count);\n}\n\n// make it part of the outgoing msg object\nmsg.count = count;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":700,"wires":[["c823ddb62bf1fe2a"]]},{"id":"e603d4c888a53abd","type":"change","z":"5b623fd31ca86a42","name":"Reset","rules":[{"t":"set","p":"topic","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":725,"y":750,"wires":[["87cb6dd3a01b9929"]]},{"id":"c823ddb62bf1fe2a","type":"switch","z":"5b623fd31ca86a42","name":"","property":"count","propertyType":"msg","rules":[{"t":"gt","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1050,"y":700,"wires":[["25e26e6fa6823f19","9330826bb3f8f958"]]},{"id":"25e26e6fa6823f19","type":"link out","z":"5b623fd31ca86a42","name":"link out 302","mode":"link","links":["0f74656a0c564a39"],"x":1140,"y":700,"wires":[]},{"id":"0f74656a0c564a39","type":"link in","z":"5b623fd31ca86a42","name":"link in 316","links":["25e26e6fa6823f19"],"x":610,"y":750,"wires":[["e603d4c888a53abd"]]},{"id":"9330826bb3f8f958","type":"debug","z":"5b623fd31ca86a42","name":"debug 2619","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"$now()","statusType":"jsonata","x":1195,"y":625,"wires":[]},{"id":"ca02c5867bf6fc79","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"'Port1: '&$flowContext('port1')& ' ' &'Port 2: ' &$flowContext('port2')\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":475,"wires":[["ffbf86141b860710"]]},{"id":"ffbf86141b860710","type":"debug","z":"5b623fd31ca86a42","name":"debug 2620","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1030,"y":475,"wires":[]}]
I think this is a long way using flow contexts, but it should work,
watch this space for expert advices from pros.