fix(core): Fix partial execution in triggerless parent case (#16833)

This commit is contained in:
Iván Ovejero
2025-06-30 15:20:15 +02:00
committed by GitHub
parent d76f05ba3d
commit 585295c89f
2 changed files with 61 additions and 2 deletions

View File

@@ -424,9 +424,27 @@ export class WorkflowExecute {
}
// 1. Find the Trigger
const trigger = findTriggerForPartialExecution(workflow, destinationNodeName, runData);
let trigger = findTriggerForPartialExecution(workflow, destinationNodeName, runData);
if (trigger === undefined) {
throw new UserError('Connect a trigger to run this node');
// destination has parents but none of them are triggers, so find the closest
// parent node that has run data, and treat that parent as starting point
let startNode;
const parentNodes = workflow.getParentNodes(destinationNodeName);
for (const nodeName of parentNodes) {
if (runData[nodeName]) {
startNode = workflow.getNode(nodeName);
break;
}
}
if (!startNode) {
throw new UserError('Connect a trigger to run this node');
}
trigger = startNode;
}
// 2. Find the Subgraph