{"record":{"id":"3b5c7dbbc05605f7","repo":"n8n-io/n8n","slug":"unknown-expression-function-functionname","errorCode":null,"errorMessage":"Unknown expression function: ${functionName}","messagePattern":"Unknown expression function: (.+?)","errorType":"exception","errorClass":"ExpressionExtensionError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/expression-runtime/src/extensions/extend.ts","lineNumber":149,"sourceCode":"/**\n * Extender function injected by expression extension plugin to allow calls to extensions.\n *\n * ```ts\n * extend(input, \"functionName\", [...args]);\n * ```\n */\nexport function extend(input: unknown, functionName: string, args: unknown[]) {\n\tconst foundFunction = findExtendedFunction(input, functionName);\n\n\t// No type specific or generic function found. Check to see if\n\t// any types have a function with that name. Then throw an error\n\t// letting the user know the available types.\n\tif (!foundFunction) {\n\t\tcheckIfValueDefinedOrThrow(input, functionName);\n\t\tconst haveFunction = EXTENSION_OBJECTS.filter((v) => functionName in v.functions);\n\t\tif (!haveFunction.length) {\n\t\t\t// This shouldn't really be possible but we should cover it anyway\n\t\t\tthrow new ExpressionExtensionError(`Unknown expression function: ${functionName}`);\n\t\t}\n\n\t\tif (haveFunction.length > 1) {\n\t\t\tconst lastType = `\"${haveFunction.pop()!.typeName}\"`;\n\t\t\tconst typeNames = `${haveFunction.map((v) => `\"${v.typeName}\"`).join(', ')}, and ${lastType}`;\n\t\t\tthrow new ExpressionExtensionError(\n\t\t\t\t`${functionName}() is only callable on types ${typeNames}`,\n\t\t\t);\n\t\t} else {\n\t\t\tthrow new ExpressionExtensionError(\n\t\t\t\t`${functionName}() is only callable on type \"${haveFunction[0].typeName}\"`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif (foundFunction.type === 'native') {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn foundFunction.function.apply(input, args);","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/expression-runtime/src/extensions/extend.ts#L131-L167","documentation":"When `extend()` is asked to run a function name that exists on NO extension type at all (and the input is defined — `checkIfValueDefinedOrThrow` passed), it throws `Unknown expression function`. This is the runtime equivalent of 'method does not exist on this value'.","triggerScenarios":"Calling a misspelled or nonexistent extension method: `{{ $json.x.frobnicate() }}`, `{{ $json.y.toIntiger() }}`, `{{ $json.z.toFixed(2) }}` (regular JS method, not an extension).","commonSituations":"Method-name typo; using a method that was renamed/removed in a version upgrade; confusing built-in JS methods with n8n expression extensions.","solutions":["Check the method spelling against the expression-extensions reference.","Confirm the method is actually an n8n extension (not a plain JS method) — native JS methods are not exposed here.","If the method exists but on the wrong type, see errors 325/326 for the type-mismatch variants."],"exampleFix":"// before\n{{ $json.price.toIntiger() }}\n// after\n{{ $json.price.toInt() }}","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['toInt','toFloat','toDateTime','toDate','toDate','isEmpty','isNotEmpty','hash','intersection','unique','isEven','isOdd','floor','ceil','round','ifEmpty','removeFieldsContaining','keepFieldsContaining','urlEncode','urlDecode']);\nconst name = $json.methodName;\nif (typeof name === 'string' && !KNOWN.has(name)) {\n  throw new Error(`Unknown expression function: ${name}`);\n}\nreturn $json;","typeGuard":"const isKnownExtension = (name: string, registry: Set<string>): name is string => registry.has(name);","tryCatchPattern":null,"preventionTips":["Cross-check method names against the expression-extensions reference.","Remember native JS methods are NOT exposed as extensions.","After a version upgrade, re-verify any custom extension names you depend on."],"tags":["expression","api-misuse","typo"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}