Skip to content

Commit

Permalink
fix(core): Handle missing resultData in runData (n8n-io#7523)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored Oct 26, 2023
1 parent d8ec6ea commit 1055bd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/WorkflowRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export class WorkflowRunner {
/**
* The process did send a hook message so execute the appropriate hook
*/
processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
void workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
async processHookMessage(workflowHooks: WorkflowHooks, hookData: IProcessMessageDataHook) {
await workflowHooks.executeHookFunctions(hookData.hook, hookData.parameters);
}

/**
Expand Down Expand Up @@ -777,7 +777,7 @@ export class WorkflowRunner {
workflowHooks,
);
} 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') {
// Execution timed out and its process has been terminated
const timeoutError = new WorkflowOperationError('Workflow execution timed out!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function determineFinalExecutionStatus(runData: IRun): ExecutionStatus {
const workflowHasCrashed = runData.status === 'crashed';
const workflowWasCanceled = runData.status === 'canceled';
const workflowDidSucceed =
!runData.data.resultData.error && !workflowHasCrashed && !workflowWasCanceled;
!runData.data.resultData?.error && !workflowHasCrashed && !workflowWasCanceled;
let workflowStatusFinal: ExecutionStatus = workflowDidSucceed ? 'success' : 'failed';
if (workflowHasCrashed) workflowStatusFinal = 'crashed';
if (workflowWasCanceled) workflowStatusFinal = 'canceled';
Expand Down

0 comments on commit 1055bd3

Please sign in to comment.