I just encoutered that the hash() function is not available in den $binary object but can be called via the $input object. Thus:
“Hash”: “{{ $input.item.binary.data.data.hash(‘sha256’) }}” - Works
but
”Hash” : “{{ $binary.data.data.hash(‘sha265) }}” - does not work / hash function is unknown in the object.
Since the hash function is must likely be called on binary data it would be an improvment to include it in the $binary object.
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
The core issue you’re encountering is that the hash() function is accessible when using the $input object but not available in the $binary object. Specifically:
When you do {{ $input.item.binary.data.data.hash('sha256') }}, it works because you’re calling hash() on a string value within the binary data.
When you try {{ $binary.data.data.hash('sha256') }}, it doesn’t work because $binary itself doesn’t have the hash() function; it’s just an object representing the binary data, not a string helper.
the hash() helper is only available for string values, and $binary is a shortcut for the binary data object, not a string. Therefore, calling hash() directly on $binary does not work.
Proposed improvement:
It would be beneficial if the $binary object included the hash() function or similar string helpers, especially since hashing binary data is a common use case. This would make the workflow more straightforward, avoiding the need to explicitly navigate to the string inside the binary object each time.
Your right / I use the $input object already (took me some time to figure this out…), but as you pointed out as well it would much cleaner to use the $binary object