For future searchers: I’ve adapted your flow above (thanks for the idea) to repeat / re-try x5 times then stop. I will use this on the ‘re-initialise Alexa’ (cookie) nodes for alexaremote2 to reboot HA or NR as I’m fed up with my Routine Speak messages failing!
Nodes you will need - https://flows.nodered.org/node/do-red
flow:
[{"id":"b4b2ec8e.7cd3d","type":"inject","z":"d9faa645.5bfcf8","name":"on","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":390,"y":440,"wires":[["e6ed6a6d.d4be08"]]},{"id":"e6ed6a6d.d4be08","type":"do","z":"d9faa645.5bfcf8","name":"","tasks":["default"],"outputs":2,"x":475,"y":440,"wires":[["18a411bf.64436e"],["598a91e2.aaf43"]],"l":false},{"id":"56fa6528.5c1d2c","type":"do-return","z":"d9faa645.5bfcf8","name":"","mode":"done","x":1190,"y":460,"wires":[]},{"id":"ca07501a.17225","type":"do-return","z":"d9faa645.5bfcf8","name":"","mode":"continue","x":1200,"y":420,"wires":[]},{"id":"e9d329d.a2a1ad8","type":"alexa-remote-routine","z":"d9faa645.5bfcf8","name":"","account":"f21390a6.9c56d","routineNode":{"type":"speak","payload":{"type":"ssml","text":{"type":"msg","value":"payload"},"devices":["G2A1A603045208G8"]}},"x":640,"y":440,"wires":[["f611ce67.cfc6a"]]},{"id":"f611ce67.cfc6a","type":"switch","z":"d9faa645.5bfcf8","name":"Null?","property":"payload","propertyType":"msg","rules":[{"t":"null"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":755,"y":440,"wires":[[],["2a86ec56.c94b54"]],"l":false},{"id":"18a411bf.64436e","type":"template","z":"d9faa645.5bfcf8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<speak>\n <voice name=\"Giorgio\">test</voice>\n</speak> ","output":"str","x":535,"y":440,"wires":[["e9d329d.a2a1ad8"]],"l":false},{"id":"88119b67.0fe858","type":"debug","z":"d9faa645.5bfcf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":380,"wires":[]},{"id":"ed5f0896.fcdb08","type":"debug","z":"d9faa645.5bfcf8","name":"reset","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":340,"wires":[]},{"id":"2a86ec56.c94b54","type":"trigger","z":"d9faa645.5bfcf8","name":"","op1":"","op2":"on","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":815,"y":440,"wires":[["6313c70e.46f2a8"]],"l":false},{"id":"2982414b.9f354e","type":"switch","z":"d9faa645.5bfcf8","name":"","property":"count","propertyType":"msg","rules":[{"t":"lt","v":"6","vt":"num"},{"t":"eq","v":"6","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":1095,"y":440,"wires":[["ca07501a.17225","88119b67.0fe858"],["56fa6528.5c1d2c"]],"l":false},{"id":"6313c70e.46f2a8","type":"counter","z":"d9faa645.5bfcf8","name":"5&done","init":"0","step":"1","lower":"0","upper":"5","mode":"increment","outputs":1,"x":940,"y":440,"wires":[["b36506ba.0a7598"]]},{"id":"b36506ba.0a7598","type":"switch","z":"d9faa645.5bfcf8","name":"","property":"reset","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1035,"y":440,"wires":[[],["2982414b.9f354e"]],"l":false},{"id":"598a91e2.aaf43","type":"change","z":"d9faa645.5bfcf8","name":"reset","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"reset","pt":"msg","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":400,"wires":[["2a86ec56.c94b54","6313c70e.46f2a8","ed5f0896.fcdb08"]]},{"id":"fe26cc6.caa0d3","type":"catch","z":"d9faa645.5bfcf8","name":"Alexa errors","scope":["e9d329d.a2a1ad8"],"uncaught":false,"x":430,"y":400,"wires":[["18a411bf.64436e"]]},{"id":"f21390a6.9c56d","type":"alexa-remote-account","name":"alexa Matty","authMethod":"proxy","proxyOwnIp":"192.168.1.104","proxyPort":"3457","cookieFile":"/config/node-red/data/amazon.txt","refreshInterval":"3","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"on"}]
pic: