{"record":{"id":"b579e8a02655acf5","repo":"n8n-io/n8n","slug":"partial-expression-path","errorCode":"PARTIAL_EXPRESSION_PATH","errorMessage":"'${nodeName}' parameter '${paramPath}' uses $json.${fieldPathStr} - exists in [${validIn.join(', ')}] but NOT in [${invalidIn.join(', ')}].","messagePattern":"'(.+?)' parameter '(.+?)' uses \\$json\\.(.+?) - exists in \\[(.+?)\\] but NOT in \\[(.+?)\\]\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/expression-path-validator.ts","lineNumber":114,"sourceCode":"\t\t\t} else {\n\t\t\t\tinvalidIn.push(pred);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst fieldPathStr = fieldPath.join('.');\n\n\tif (invalidIn.length > 0 && validIn.length === 0) {\n\t\tissues.push({\n\t\t\tcode: 'INVALID_EXPRESSION_PATH',\n\t\t\tmessage: `'${nodeName}' parameter '${paramPath}' uses $json.${fieldPathStr} but no predecessor outputs this field.`,\n\t\t\tseverity: 'warning',\n\t\t\tnodeName,\n\t\t\tparameterPath: paramPath,\n\t\t});\n\t} else if (invalidIn.length > 0 && validIn.length > 0) {\n\t\tissues.push({\n\t\t\tcode: 'PARTIAL_EXPRESSION_PATH',\n\t\t\tmessage: `'${nodeName}' parameter '${paramPath}' uses $json.${fieldPathStr} - exists in [${validIn.join(', ')}] but NOT in [${invalidIn.join(', ')}].`,\n\t\t\tseverity: 'warning',\n\t\t\tnodeName,\n\t\t\tparameterPath: paramPath,\n\t\t});\n\t}\n}\n\n/**\n * Validate that $('NodeName').item.json.path references a valid field\n */\nfunction validateNodePath(\n\tnodeName: string,\n\tparamPath: string,\n\treferencedNode: string,\n\tfieldPath: string[],\n\toutputShapes: Map<string, Record<string, unknown>>,\n\tissues: ValidationIssue[],","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/plugins/validators/expression-path-validator.ts#L96-L132","documentation":"Warning-level validator issue (code PARTIAL_EXPRESSION_PATH) emitted when an expression references $json.<fieldPath> that exists in SOME predecessors but NOT all of them. The message lists which predecessors provide the field (validIn) and which do not (invalidIn), so the builder knows which branches will resolve and which will return undefined.","triggerScenarios":"A node with multiple upstream branches where only some output the referenced field; merging heterogeneous sources and referencing a field only one branch provides.","commonSituations":"Conditional branches that diverge in output schema; nodes whose output depends on a mode/option; refactors that change one branch's fields.","solutions":["Make all predecessor branches output the referenced field (normalize outputs).","Restructure so only branches that actually have the field are predecessors.","Use a conditional/fallback in the expression to handle the missing-field case."],"exampleFix":"// before\n'={{ $json.optionalField }}'\n// some predecessors omit optionalField\n// after\n'={{ $json.optionalField ?? \"default\" }}'","handlingStrategy":"validation","validationCode":"const valid = preds.filter(p => hasPath(shapeOf(p), fieldPath));\nconst invalid = preds.filter(p => !hasPath(shapeOf(p), fieldPath));\nif (valid.length > 0 && invalid.length > 0) {\n  // warn: partial — normalize outputs or guard the expression\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize output schemas across branches that merge into one node.","Add fallbacks ('?? default') when a field may be absent on some branches.","Prefer homogeneous upstream outputs for shared expressions."],"tags":["expression","validator","field-path","branches"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}