n8n-io/n8n · error · ExpressionExtensionError
Unknown algorithm ${algorithm}. Available algorithms are: ${
Error message
Unknown algorithm ${algorithm}. Available algorithms are: ${SupportedHashAlgorithms.join()}, and Base64. What it means
`.hash(algorithm)` supports exactly `md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `sha3` (mapped to SHA3-512), and `base64`. The algorithm is lowercased before the switch, so case is not the issue — an unsupported NAME is. Anything else hits the `default` branch and throws, listing the valid set.
Source
Thrown at packages/@n8n/expression-runtime/src/extensions/string-extensions.ts:112
case 'sha1':
case 'sha224':
case 'sha256':
case 'sha384':
case 'sha512':
case 'sha3':
const variant = (
{
sha1: 'SHA-1',
sha224: 'SHA-224',
sha256: 'SHA-256',
sha384: 'SHA-384',
sha512: 'SHA-512',
sha3: 'SHA3-512',
} as const
)[algorithm];
return new SHA(variant, 'TEXT').update(value).getHash('HEX');
default:
throw new ExpressionExtensionError(
`Unknown algorithm ${algorithm}. Available algorithms are: ${SupportedHashAlgorithms.join()}, and Base64.`,
);
}
}
function isEmpty(value: string): boolean {
return value === '';
}
function isNotEmpty(value: string): boolean {
return !isEmpty(value);
}
function length(value: string): number {
return value.length;
}
export function toJsonString(value: string): string {View on GitHub (pinned to 5ac6606e81)
Solutions
- Use one of the listed algorithms (`md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `sha3`, `base64`).
- If you need an unsupported digest, compute it in a Code node with `node:crypto`.
- For Base64 encoding specifically, pass `'base64'` rather than a hash name.
Example fix
// before
{{ $json.s.hash('crc32') }}
// after
{{ $json.s.hash('sha256') }} Defensive patterns
Strategy: validation
Validate before calling
const ALGOS = new Set(['md5','sha1','sha224','sha256','sha384','sha512','sha3','base64']);
const algo = String($json.algo || '').toLowerCase();
if (!ALGOS.has(algo)) {
throw new Error(`hash(): unsupported algorithm '${algo}'`);
}
return $json; Type guard
const isSupportedHash = (a: string): a is 'md5'|'sha1'|'sha224'|'sha256'|'sha384'|'sha512'|'sha3'|'base64' => ['md5','sha1','sha224','sha256','sha384','sha512','sha3','base64'].includes(a.toLowerCase());
Prevention
- Use one of md5/sha1/sha224/sha256/sha384/sha512/sha3/base64.
- For unsupported digests, compute in a Code node with node:crypto.
- Use `'base64'` for encoding rather than a hash name.
When it happens
Trigger: `.hash('crc32')`, `.hash('md4')`, `.hash('sha128')`, `.hash('ripemd160')`.
Common situations: Asking for a hash n8n does not bundle; typo in the algorithm name; assuming the full jsSHA catalogue is exposed.
Related errors
- removeFieldsContaining(): expected non-empty string arg
- argument of keepFieldsContaining must be a non-empty string
- intersection(): expected array arg, e.g. .intersection([1, 2
- Unsupported unit '${String(errorUnit)}'. Supported: ${durati
- keys and values must be arrays
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/e299a3d684ba43d6.
Report an issue: GitHub.