1
0
Fork 0
mirror of https://github.com/n8n-io/n8n.git synced 2025-03-05 20:50:17 -08:00

fix(core): Handle missing resultData in runData ()

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-10-26 13:15:19 +02:00 committed by GitHub
parent d8ec6eac40
commit 1055bd3762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions
packages/cli/src
WorkflowRunner.ts
executionLifecycleHooks/shared

View file

@ -73,8 +73,8 @@ export class WorkflowRunner {
/** /**
* The process did send a hook message so execute the appropriate hook * The process did send a hook message so execute the appropriate hook
*/ */
processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) { async processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
void workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters); await workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
} }
/** /**
@ -777,7 +777,7 @@ export class WorkflowRunner {
workflowHooks, workflowHooks,
); );
} else if (message.type === 'processHook') { } else if (message.type === 'processHook') {
this.processHookMessage(workflowHooks, message.data as IProcessMessageDataHook); await this.processHookMessage(workflowHooks, message.data as IProcessMessageDataHook);
} else if (message.type === 'timeout') { } else if (message.type === 'timeout') {
// Execution timed out and its process has been terminated // Execution timed out and its process has been terminated
const timeoutError = new WorkflowOperationError('Workflow execution timed out!'); const timeoutError = new WorkflowOperationError('Workflow execution timed out!');

View file

@ -11,7 +11,7 @@ export function determineFinalExecutionStatus(runData: IRun): ExecutionStatus {
const workflowHasCrashed = runData.status === 'crashed'; const workflowHasCrashed = runData.status === 'crashed';
const workflowWasCanceled = runData.status === 'canceled'; const workflowWasCanceled = runData.status === 'canceled';
const workflowDidSucceed = const workflowDidSucceed =
!runData.data.resultData.error && !workflowHasCrashed && !workflowWasCanceled; !runData.data.resultData?.error && !workflowHasCrashed && !workflowWasCanceled;
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed'; let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
if (workflowHasCrashed) workflowStatusFinal = 'crashed'; if (workflowHasCrashed) workflowStatusFinal = 'crashed';
if (workflowWasCanceled) workflowStatusFinal = 'canceled'; if (workflowWasCanceled) workflowStatusFinal = 'canceled';