{"record":{"id":"7213ce0f2afe70e9","repo":"n8n-io/n8n","slug":"expected-two-arguments-object-string-for-this-f","errorCode":null,"errorMessage":"expected two arguments (Object, string) for this function","messagePattern":"expected two arguments \\(Object, string\\) for this function","errorType":"exception","errorClass":"ExpressionError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/expression-runtime/src/runtime/jmespath.ts","lineNumber":68,"sourceCode":" *   - Throws `ExpressionError` (same name) when args are wrong.\n *   - Rejects queries that contain unsafe property tokens.\n *   - Does NOT spread `data` before querying. Host-side, the top-level\n *     spread exists to strip proxies off the data before handing it to\n *     jmespath; in-isolate that is a no-op (nested values stay lazy\n *     proxies either way, and the isolate boundary already prevents\n *     host-object leakage), while spreading a lazy proxy (e.g. `$json`)\n *     would cost one synchronous host roundtrip per top-level key\n *     before the query even runs.\n *\n * Note on lazy proxies: when `data` is a lazy proxy (e.g. `$json`), each\n * property access during `jmespath.search` triggers a synchronous host\n * roundtrip via `getValueAtPath`. Functional but slow for deep traversals.\n * Performance optimisation (e.g. bulk pre-fetch of the queried subtree) is\n * a follow-up.\n */\nexport function jmesPath(data: unknown, query: string): unknown {\n\tif (typeof data !== 'object' || typeof query !== 'string') {\n\t\tthrow new ExpressionError('expected two arguments (Object, string) for this function');\n\t}\n\n\t// jmespath decodes escape sequences inside quoted identifiers, so the\n\t// token check must run against an unescaped query. Reject any backslash\n\t// up front to keep the property-name match meaningful.\n\tif (query.includes('\\\\') || unsafeJmespathPropertyPattern.test(query)) {\n\t\tthrow new ExpressionError(\n\t\t\t'Cannot access this property in a jmespath query due to security concerns',\n\t\t);\n\t}\n\n\treturn jmespath.search(data as never, query);\n}\n","sourceCodeStart":50,"sourceCodeEnd":82,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/expression-runtime/src/runtime/jmespath.ts#L50-L82","documentation":"Error \"expected two arguments (Object, string) for this function\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/expression-runtime/src/runtime/jmespath.ts:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}