{"record":{"id":"9cc548da4052c92f","repo":"n8n-io/n8n","slug":"the-function-functionname-is-not-supported-in","errorCode":null,"errorMessage":"The function \"${functionName}\" is not supported in the Code Node","messagePattern":"The function \"(.+?)\" is not supported in the Code Node","errorType":"exception","errorClass":"UnsupportedFunctionError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/task-runner/src/js-task-runner/js-task-runner.ts","lineNumber":602,"sourceCode":"\n\t\t\tthis.nodeTypes.addNodeTypeDescriptions(nodeTypes);\n\t\t}\n\t}\n\n\tprivate buildRpcCallObject(taskId: string) {\n\t\tconst rpcObject: RpcCallObject = {};\n\n\t\tfor (const rpcMethod of EXPOSED_RPC_METHODS) {\n\t\t\tset(\n\t\t\t\trpcObject,\n\t\t\t\trpcMethod.split('.'),\n\t\t\t\tasync (...args: unknown[]) => await this.makeRpcCall(taskId, rpcMethod, args),\n\t\t\t);\n\t\t}\n\n\t\tfor (const rpcMethod of UNSUPPORTED_HELPER_FUNCTIONS) {\n\t\t\tset(rpcObject, rpcMethod.split('.'), () => {\n\t\t\t\tthrow new UnsupportedFunctionError(rpcMethod);\n\t\t\t});\n\t\t}\n\n\t\treturn rpcObject;\n\t}\n\n\tprivate buildCustomConsole(taskId: string): CustomConsole {\n\t\treturn {\n\t\t\t// all except `log` are dummy methods that disregard without throwing, following existing Code node behavior\n\t\t\t...JsTaskRunner.CONSOLE_METHODS.reduce<Record<string, () => void>>((acc, name) => {\n\t\t\t\tacc[name] = noOp;\n\t\t\t\treturn acc;\n\t\t\t}, {}),\n\n\t\t\t// Send log output back to the main process. It will take care of forwarding\n\t\t\t// it to the UI or printing to console.\n\t\t\tlog: (...args: unknown[]) => {\n\t\t\t\tconst formattedLogArgs = args.map((arg) => {","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/task-runner/src/js-task-runner/js-task-runner.ts#L584-L620","documentation":"Thrown by the JS Task Runner when user code in a Code Node calls one of the helper functions explicitly listed in UNSUPPORTED_HELPER_FUNCTIONS. These are helpers that exist in the regular Code Node execution context but are deliberately not exposed in the task runner (e.g. credential-dependent helpers, stream-based helpers, or removed/deprecated functions). The runner installs a stub that throws UnsupportedFunctionError immediately on invocation.","triggerScenarios":"User JavaScript in a Code Node running in task-runner mode calls one of: helpers.httpRequestWithAuthentication, helpers.requestWithAuthenticationPaginated, helpers.copyBinaryFile, helpers.createReadStream, helpers.getBinaryStream, helpers.binaryToBufgetBinaryMetadata, helpers.getStoragePath, helpers.getBinaryPath, or other functions in the UNSUPPORTED_HELPER_FUNCTIONS list. The stub function placed by buildRpcCallObject intercepts the call and throws.","commonSituations":"Migrating a workflow from the internal Code Node execution mode to the task runner (ADVANCED_CODE_EXECUTION or external runner). Using helpers that depend on credentials in a Code Node that has none. Using stream-based binary helpers that can't be serialized over the RPC boundary between runner and main process.","solutions":["Replace helpers.httpRequestWithAuthentication with a manual credential fetch + helpers.httpRequest call.","For binary/stream helpers, use $input.item.json to access binary metadata or move the logic to a dedicated node.","For helpers.copyBinaryFile (removed), use the binary data write API or a suitable node instead.","Check the UNSUPPORTED_HELPER_FUNCTIONS list in runner-types.ts to confirm which helpers are unavailable in task-runner mode."],"exampleFix":"// before\nconst response = await this.helpers.httpRequestWithAuthentication.call(\n  this,\n  'myApi',\n  { method: 'GET', url: 'https://api.example.com/data' }\n);\n// after — fetch credential and use plain httpRequest\nconst cred = await this.helpers.getCredentials.call(this, 'myApi');\nconst response = await this.helpers.httpRequest({\n  method: 'GET',\n  url: 'https://api.example.com/data',\n  headers: { Authorization: `Bearer ${cred.token}` },\n});","handlingStrategy":"try-catch","validationCode":"import { UNSUPPORTED_HELPER_FUNCTIONS } from '@n8n/task-runner/runner-types';\n\n// Check before calling if the helper might be unsupported\nfunction isUnsupportedHelper(path: string): boolean {\n  return UNSUPPORTED_HELPER_FUNCTIONS.includes(path as any);\n}\n\nif (isUnsupportedHelper('helpers.createReadStream')) {\n  // use an alternative approach\n}","typeGuard":null,"tryCatchPattern":"import { UnsupportedFunctionError } from '@n8n/task-runner';\n\ntry {\n  const result = await this.helpers.someHelper();\n} catch (e) {\n  if (e instanceof UnsupportedFunctionError) {\n    // fall back to an alternative implementation\n    return await alternativeApproach();\n  }\n  throw e;\n}","preventionTips":["Check the UNSUPPORTED_HELPER_FUNCTIONS list when writing Code Node code that may run in task-runner mode.","Avoid credential-dependent helpers in Code Nodes — use dedicated nodes for authenticated requests.","Don't use stream-based helpers in Code Nodes running in the task runner.","Test Code Node code in task-runner mode before deploying to production."],"tags":["task-runner","code-node","rpc","unsupported-api"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}