Formatting a Hex Buffer in Automator
Written by Gary Brindley
Updated at December 23rd, 2025
Question:
How do you format a hexadecimcal command as a Buffer type in Automator?
Answer:
Sometimes you need to pass a Buffer type as part of the msg.payload value in Automator. When using a hex string, Node-red formats this in an odd way. Normally a hex string is formatted "$81, $01, $06, $01". When using the Buffer type in Automator, the hex string is turned into an array where the format is now ["0x81","0x01","0x06,"0x01"]. Here is an example image from Automator:

The function node can also be used to build a buffer using JavaScript, and is used in a similar fashion. In the case of the JS function, you use the Buffer.from method. For example:
Buffer.from ([0x81,0x01,0x06,0x01])