Not sure if you achieve it yet but I was able to do something similar with function
[{"id":"6c6f8f3b5cb8c76b","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"fd1e7c0a2369b95c","type":"api-call-service","z":"6c6f8f3b5cb8c76b","name":"","server":"32b5eb9d.1cbe84","version":5,"debugenabled":false,"domain":"{{payload.domain}}","service":"{{payload.service}}","areaId":[],"deviceId":[],"entityId":["{{payload.target.entity_id}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1070,"y":560,"wires":[[]]},{"id":"1e1ad248796bf6eb","type":"function","z":"6c6f8f3b5cb8c76b","name":"function 1","func":"\nvar velocidad = {payload:\n {\n \"domain\": \"climate\",\n \"service\": \"set_fan_mode\",\n \"target\": {\n \"entity_id\": [\n \"climate.c67428b9\"\n ]\n },\n \"data\": {\n \"fan_mode\": \"auto\"\n }\n }\n}\nnode.send(velocidad);\nvar temperatura = {\n payload:\n {\n \"domain\": \"climate\",\n \"service\": \"set_temperature\",\n \"target\": {\n \"entity_id\": [\n \"climate.c67428b9\"\n ]\n },\n \"data\": {\n \"temperature\": 20\n }\n }\n}\nnode.send(temperatura);\nvar preset = {\n payload:\n {\n \"domain\": \"climate\",\n \"service\": \"set_preset_mode\",\n \"target\": {\n \"entity_id\": [\n \"climate.c67428b9\"\n ]\n },\n \"data\": {\n \"preset_mode\": \"boost\"\n }\n }\n}\nnode.send(preset);\nvar swing = {\n payload:\n {\n \"domain\": \"climate\",\n \"service\": \"set_swing_mode\",\n \"target\": {\n \"entity_id\": [\n \"climate.c67428b9\"\n ]\n },\n \"data\": {\n \"swing_mode\": \"vertical\"\n }\n }\n}\nnode.send(swing);\nreturn;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":560,"wires":[["fd1e7c0a2369b95c"]]},{"id":"320ca178f6b878dc","type":"inject","z":"6c6f8f3b5cb8c76b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":640,"y":560,"wires":[["1e1ad248796bf6eb"]]},{"id":"32b5eb9d.1cbe84","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]