From 27578ccdcca3dc1923b3607e9e891e453b420fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 12 Nov 2024 11:52:40 +0100 Subject: [PATCH] add a new execution status type `executionWaiting` --- packages/@n8n/api-types/src/push/execution.ts | 10 ++++++++++ packages/cli/src/workflow-execute-additional-data.ts | 6 ++++-- .../editor-ui/src/composables/usePushConnection.ts | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/@n8n/api-types/src/push/execution.ts b/packages/@n8n/api-types/src/push/execution.ts index 78c0b34a36..173f61d654 100644 --- a/packages/@n8n/api-types/src/push/execution.ts +++ b/packages/@n8n/api-types/src/push/execution.ts @@ -12,6 +12,15 @@ type ExecutionStarted = { }; }; +type ExecutionWaiting = { + type: 'executionWaiting'; + data: { + executionId: string; + data: IRun; + retryOf?: string; + }; +}; + type ExecutionFinished = { type: 'executionFinished'; data: { @@ -47,6 +56,7 @@ type NodeExecuteAfter = { export type ExecutionPushMessage = | ExecutionStarted + | ExecutionWaiting | ExecutionFinished | ExecutionRecovered | NodeExecuteBefore diff --git a/packages/cli/src/workflow-execute-additional-data.ts b/packages/cli/src/workflow-execute-additional-data.ts index 2031c4b5da..80b311a423 100644 --- a/packages/cli/src/workflow-execute-additional-data.ts +++ b/packages/cli/src/workflow-execute-additional-data.ts @@ -347,9 +347,11 @@ function hookFunctionsPush(): IWorkflowExecuteHooks { executionId, workflowId, }); - // TODO: Look at this again + + const pushType = + fullRunData.status === 'waiting' ? 'executionWaiting' : 'executionFinished'; pushInstance.send( - 'executionFinished', + pushType, { executionId, data: pushRunData, diff --git a/packages/editor-ui/src/composables/usePushConnection.ts b/packages/editor-ui/src/composables/usePushConnection.ts index ea9f79d27e..76ad7ed97b 100644 --- a/packages/editor-ui/src/composables/usePushConnection.ts +++ b/packages/editor-ui/src/composables/usePushConnection.ts @@ -499,6 +499,8 @@ export function usePushConnection({ router }: { router: ReturnType