mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(core): Report malformed execution data (#12525)
This commit is contained in:
parent
858b86a284
commit
0c5b3097bb
|
@ -899,7 +899,27 @@ export class WorkflowExecute {
|
||||||
|
|
||||||
this.status = 'running';
|
this.status = 'running';
|
||||||
|
|
||||||
const startNode = this.runExecutionData.executionData!.nodeExecutionStack[0].node.name;
|
if (!this.runExecutionData.executionData) {
|
||||||
|
throw new ApplicationError('Failed to run workflow due to missing execution data', {
|
||||||
|
extra: {
|
||||||
|
workflowId: workflow.id,
|
||||||
|
executionid: this.additionalData.executionId,
|
||||||
|
mode: this.mode,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const startNode = this.runExecutionData.executionData.nodeExecutionStack.at(0)?.node.name;
|
||||||
|
|
||||||
|
if (!startNode) {
|
||||||
|
throw new ApplicationError('Failed to run workflow due to empty node execution stack', {
|
||||||
|
extra: {
|
||||||
|
workflowId: workflow.id,
|
||||||
|
executionId: this.additionalData.executionId,
|
||||||
|
mode: this.mode,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let destinationNode: string | undefined;
|
let destinationNode: string | undefined;
|
||||||
if (this.runExecutionData.startData && this.runExecutionData.startData.destinationNode) {
|
if (this.runExecutionData.startData && this.runExecutionData.startData.destinationNode) {
|
||||||
|
@ -934,7 +954,7 @@ export class WorkflowExecute {
|
||||||
|
|
||||||
if (this.runExecutionData.waitTill) {
|
if (this.runExecutionData.waitTill) {
|
||||||
const lastNodeExecuted = this.runExecutionData.resultData.lastNodeExecuted as string;
|
const lastNodeExecuted = this.runExecutionData.resultData.lastNodeExecuted as string;
|
||||||
this.runExecutionData.executionData!.nodeExecutionStack[0].node.disabled = true;
|
this.runExecutionData.executionData.nodeExecutionStack[0].node.disabled = true;
|
||||||
this.runExecutionData.waitTill = undefined;
|
this.runExecutionData.waitTill = undefined;
|
||||||
this.runExecutionData.resultData.runData[lastNodeExecuted].pop();
|
this.runExecutionData.resultData.runData[lastNodeExecuted].pop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue