mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
add a new execution status type executionWaiting
This commit is contained in:
parent
78c42b7f26
commit
f7d26519ff
|
@ -12,6 +12,13 @@ type ExecutionStarted = {
|
|||
};
|
||||
};
|
||||
|
||||
type ExecutionWaiting = {
|
||||
type: 'executionWaiting';
|
||||
data: {
|
||||
executionId: string;
|
||||
};
|
||||
};
|
||||
|
||||
type ExecutionFinished = {
|
||||
type: 'executionFinished';
|
||||
data: {
|
||||
|
@ -45,6 +52,7 @@ type NodeExecuteAfter = {
|
|||
|
||||
export type ExecutionPushMessage =
|
||||
| ExecutionStarted
|
||||
| ExecutionWaiting
|
||||
| ExecutionFinished
|
||||
| ExecutionRecovered
|
||||
| NodeExecuteBefore
|
||||
|
|
|
@ -309,7 +309,7 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
|
|||
},
|
||||
],
|
||||
workflowExecuteAfter: [
|
||||
async function (this: WorkflowHooks): Promise<void> {
|
||||
async function (this: WorkflowHooks, fullRunData: IRun): Promise<void> {
|
||||
const { pushRef, executionId } = this;
|
||||
if (pushRef === undefined) return;
|
||||
|
||||
|
@ -320,7 +320,9 @@ function hookFunctionsPush(): IWorkflowExecuteHooks {
|
|||
workflowId,
|
||||
});
|
||||
|
||||
pushInstance.send('executionFinished', { executionId }, pushRef);
|
||||
const pushType =
|
||||
fullRunData.status === 'waiting' ? 'executionWaiting' : 'executionFinished';
|
||||
pushInstance.send(pushType, { executionId }, pushRef);
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -913,7 +913,6 @@ export class WorkflowExecute {
|
|||
let nodeSuccessData: INodeExecutionData[][] | null | undefined;
|
||||
let runIndex: number;
|
||||
let startTime: number;
|
||||
let taskData: ITaskData;
|
||||
|
||||
if (this.runExecutionData.startData === undefined) {
|
||||
this.runExecutionData.startData = {};
|
||||
|
@ -1443,12 +1442,12 @@ export class WorkflowExecute {
|
|||
this.runExecutionData.resultData.runData[executionNode.name] = [];
|
||||
}
|
||||
|
||||
taskData = {
|
||||
const taskData: ITaskData = {
|
||||
hints: executionHints,
|
||||
startTime,
|
||||
executionTime: new Date().getTime() - startTime,
|
||||
source: !executionData.source ? [] : executionData.source.main,
|
||||
executionStatus: 'success',
|
||||
executionStatus: this.runExecutionData.waitTill ? 'waiting' : 'success',
|
||||
};
|
||||
|
||||
if (executionError !== undefined) {
|
||||
|
|
|
@ -446,13 +446,17 @@ export function usePushConnection({ router }: { router: ReturnType<typeof useRou
|
|||
runDataExecutedStartData: iRunExecutionData.startData,
|
||||
resultDataError: iRunExecutionData.resultData.error,
|
||||
});
|
||||
} else if (receivedData.type === 'executionWaiting') {
|
||||
// Nothing to do
|
||||
} else if (receivedData.type === 'executionStarted') {
|
||||
// Nothing to do
|
||||
} else if (receivedData.type === 'nodeExecuteAfter') {
|
||||
// A node finished to execute. Add its data
|
||||
const pushData = receivedData.data;
|
||||
workflowsStore.addNodeExecutionData(pushData);
|
||||
workflowsStore.removeExecutingNode(pushData.nodeName);
|
||||
if (pushData.data.executionStatus !== 'waiting') {
|
||||
workflowsStore.removeExecutingNode(pushData.nodeName);
|
||||
}
|
||||
void assistantStore.onNodeExecution(pushData);
|
||||
} else if (receivedData.type === 'nodeExecuteBefore') {
|
||||
// A node started to be executed. Set it as executing.
|
||||
|
|
Loading…
Reference in a new issue