{"record":{"id":"b6c52f589a5c53ef","repo":"n8n-io/n8n","slug":"unsupported-syntax-logical-operator-string-nod","errorCode":null,"errorMessage":"Unsupported syntax: 'Logical operator ${String(node.operator)}' is not allowed in SDK code","messagePattern":"Unsupported syntax: 'Logical operator (.+?)' is not allowed in SDK code","errorType":"exception","errorClass":"UnsupportedNodeError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/ast-interpreter/interpreter.ts","lineNumber":676,"sourceCode":"\t\t}\n\t}\n\n\t/**\n\t * Visit a logical expression.\n\t */\n\tprivate visitLogicalExpression(node: ESTree.LogicalExpression): unknown {\n\t\tconst left = this.evaluate(node.left);\n\n\t\tswitch (node.operator) {\n\t\t\tcase '&&':\n\t\t\t\treturn left ? this.evaluate(node.right) : left;\n\t\t\tcase '||':\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Implementing JS || semantics\n\t\t\t\treturn left ? left : this.evaluate(node.right);\n\t\t\tcase '??':\n\t\t\t\treturn left ?? this.evaluate(node.right);\n\t\t\tdefault:\n\t\t\t\tthrow new UnsupportedNodeError(\n\t\t\t\t\t`Logical operator ${String(node.operator)}`,\n\t\t\t\t\tnode.loc ?? undefined,\n\t\t\t\t\tthis.sourceCode,\n\t\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Visit a conditional expression (ternary).\n\t */\n\tprivate visitConditionalExpression(node: ESTree.ConditionalExpression): unknown {\n\t\tconst test = this.evaluate(node.test);\n\t\treturn test ? this.evaluate(node.consequent) : this.evaluate(node.alternate);\n\t}\n\n\t/**\n\t * Visit an assignment expression.\n\t * Only allows simple property assignment (obj.prop = value).","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/ast-interpreter/interpreter.ts#L658-L694","documentation":"The interpreter supports the three JavaScript logical operators: `&&`, `||`, and `??` (nullish coalescing). Since these are the only logical operators in the language, the `default` case at interpreter.ts:676 is effectively unreachable through standard parsing — it exists as a defensive guard for malformed AST nodes or future language extensions.","triggerScenarios":"Unreachable through valid JavaScript — all standard logical operators (`&&`, `||`, `??`) have cases in the switch at interpreter.ts:667. Could only fire with a non-standard or malformed AST node of type `LogicalExpression` with an unknown operator.","commonSituations":"Internal development or parser extensions; extremely unlikely in production. Not a user-fixable syntax issue.","solutions":["This error should not occur with valid JS — verify the parser and AST source","If extending the interpreter: add the new operator to the `visitLogicalExpression` switch","Simplify to standard `&&`, `||`, or `??` operators"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Not user-validatable — all standard logical operators are supported.\n// If encountered, the AST is malformed or non-standard.","typeGuard":null,"tryCatchPattern":"import { UnsupportedNodeError } from '@n8n/workflow-sdk/ast-interpreter/errors';\n\ntry {\n  interpretSDKCode(sdkCode, sdkFunctions);\n} catch (e) {\n  if (e instanceof UnsupportedNodeError && e.message.includes('Logical operator')) {\n    // log as internal/parser issue — standard JS should never trigger this\n  }\n  throw e;\n}","preventionTips":["Use only `&&`, `||`, and `??` — these are all standard logical operators","This error is effectively unreachable with valid JavaScript","If encountered, verify the parser configuration and AST integrity"],"tags":["sdk-interpreter","logical-operator","unreachable","defense-in-depth"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}