mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(core): Fix partial execution in triggerless parent case (#16833)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user