fix(core): Replace misleading "No path back to node" error with helpful execution message (#17759)

This commit is contained in:
Csaba Tuncsik
2025-07-29 17:22:11 +02:00
committed by GitHub
parent d16960bad3
commit 164800f6a4
4 changed files with 710 additions and 9 deletions

View File

@@ -1080,7 +1080,13 @@ export class WorkflowDataProxy {
!that?.runExecutionData?.resultData?.runData.hasOwnProperty(nodeName) &&
!getPinDataIfManualExecution(that.workflow, nodeName, that.mode)
) {
throw createNodeReferenceError(nodeName);
// Always show helpful "Execute node for preview" message
throw new ExpressionError(EXPRESSION_ERROR_MESSAGES.NO_EXECUTION_DATA, {
messageTemplate: `Execute node "${nodeName}" for preview`,
nodeCause: nodeName,
runIndex: that.runIndex,
itemIndex: that.itemIndex,
});
}
};
@@ -1098,7 +1104,10 @@ export class WorkflowDataProxy {
contextNode = parentMainInputNode?.name ?? contextNode;
}
if (!that.workflow.hasPath(nodeName, contextNode)) {
// For .first(), .last(), .all() methods, use unidirectional path checking
// (forward only) to maintain traditional paired item behavior
const hasForwardPath = that.workflow.getChildNodes(nodeName).includes(contextNode);
if (!hasForwardPath) {
throw createNodeReferenceError(nodeName);
}
};