{"record":{"id":"004c3fd24def4031","repo":"n8n-io/n8n","slug":"unsupported-syntax-node-type-is-not-allowed","errorCode":null,"errorMessage":"Unsupported syntax: '${node.type}' is not allowed in SDK code","messagePattern":"Unsupported syntax: '(.+?)' is not allowed in SDK code","errorType":"exception","errorClass":"UnsupportedNodeError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/ast-interpreter/validators.ts","lineNumber":271,"sourceCode":"\tAwaitExpression: 'Await expressions are not allowed in SDK code',\n\tYieldExpression: 'Yield expressions are not allowed in SDK code',\n};\n\n/**\n * Check if a node type is allowed.\n * @throws UnsupportedNodeError if the node type is not allowed\n */\nexport function validateNodeType(node: Node, sourceCode: string): void {\n\tif (FORBIDDEN_NODE_TYPES[node.type]) {\n\t\tthrow new UnsupportedNodeError(\n\t\t\t`${node.type}: ${FORBIDDEN_NODE_TYPES[node.type]}`,\n\t\t\tnode.loc ?? undefined,\n\t\t\tsourceCode,\n\t\t);\n\t}\n\n\tif (!ALLOWED_NODE_TYPES.has(node.type)) {\n\t\tthrow new UnsupportedNodeError(node.type, node.loc ?? undefined, sourceCode);\n\t}\n}\n\n/**\n * Check if an identifier is a dangerous global.\n * @throws SecurityError if the identifier is dangerous\n */\nexport function validateIdentifier(\n\tname: string,\n\t_allowedVariables: Set<string>,\n\tnode: Node,\n\tsourceCode: string,\n): void {\n\tif (DANGEROUS_GLOBALS.has(name)) {\n\t\tthrow new SecurityError(name, node.loc ?? undefined, sourceCode);\n\t}\n}\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/ast-interpreter/validators.ts#L253-L289","documentation":"Thrown by validateNodeType when the AST node type is NOT in ALLOWED_NODE_TYPES and also not in FORBIDDEN_NODE_TYPES. This is a closed-world allowlist: any node type the interpreter has not explicitly allowed is rejected. Unlike 1144, there is no remediation string — only the raw node type is reported.","triggerScenarios":"Any ES construct whose AST type is outside the allowlist: e.g., TaggedTemplateExpression, SequenceExpression (comma operator), AssignmentPattern (default parameters/destructuring defaults), ConditionalExpression chains with unusual nesting, EmptyStatement, LabeledStatement, BreakStatement, ContinueStatement, ReturnStatement (outside functions), ThisExpression, MetaProperty, ChainExpression.","commonSituations":"Using newer/less-common JS syntax the allowlist hasn't been updated for; tagged templates like sql`...`; comma-operator chains; labeled loops; `this` references; destructuring with defaults.","solutions":["Identify the node type named in the error and remove that construct from the SDK code.","Replace the construct with an allowed equivalent (e.g., replace a tagged template with a plain string; replace comma operator with separate statements).","If the construct seems essential to the SDK DSL, file an issue / extend ALLOWED_NODE_TYPES in validators.ts and add interpreter support — but do not bypass the check."],"exampleFix":"// before (TaggedTemplateExpression)\nconst q = sql`SELECT * FROM t`;\n\n// after\nconst q = 'SELECT * FROM t';","handlingStrategy":"validation","validationCode":"import { parseSDKCode } from '@n8n/workflow-sdk/ast-interpreter/parser';\nimport { ALLOWED_NODE_TYPES } from '@n8n/workflow-sdk/ast-interpreter/validators';\n\nfunction findUnknownNodeTypes(code: string): string[] {\n  const unknown: string[] = [];\n  const ast = parseSDKCode(code);\n  JSON.stringify(ast, (k, v) => {\n    if (v && typeof v === 'object' && 'type' in v) {\n      const t = (v as { type: string }).type;\n      if (!ALLOWED_NODE_TYPES.has(t)) unknown.push(t);\n    }\n    return v;\n  });\n  return [...new Set(unknown)];\n}","typeGuard":"import { ALLOWED_NODE_TYPES } from '@n8n/workflow-sdk/ast-interpreter/validators';\n\nfunction isAllowedNode(type: string): boolean {\n  return ALLOWED_NODE_TYPES.has(type);\n}","tryCatchPattern":"import { interpretSDKCode } from '@n8n/workflow-sdk/ast-interpreter/interpreter';\nimport { UnsupportedNodeError } from '@n8n/workflow-sdk/ast-interpreter/errors';\n\ntry {\n  interpretSDKCode(code, sdkFunctions);\n} catch (e) {\n  if (e instanceof UnsupportedNodeError && !e.message.includes(':')) {\n    // bare node type → not in allowlist and not in FORBIDDEN map\n  }\n  throw e;\n}","preventionTips":["Maintain a quick reference of ALLOWED_NODE_TYPES and stay within it.","Avoid exotic syntax (tagged templates, comma operator, labeled statements, this).","If you need a construct outside the allowlist, run it in a Code node instead."],"tags":["sdk","validators","allowlist","unsupported-syntax"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}