diff --git a/packages/cli/src/events/__tests__/log-streaming-event-relay.test.ts b/packages/cli/src/events/__tests__/log-streaming-event-relay.test.ts index 7254f5a09bfc6..720e2d494c332 100644 --- a/packages/cli/src/events/__tests__/log-streaming-event-relay.test.ts +++ b/packages/cli/src/events/__tests__/log-streaming-event-relay.test.ts @@ -142,7 +142,12 @@ describe('LogStreamingEventRelay', () => { executionId: 'some-id', userId: 'some-id', workflow: mock({ id: 'some-id', name: 'some-name' }), - runData: mock({ status: 'success', mode: 'manual', data: { resultData: {} } }), + runData: mock({ + finished: true, + status: 'success', + mode: 'manual', + data: { resultData: {} }, + }), }); eventService.emit('workflow-post-execute', payload); @@ -153,7 +158,7 @@ describe('LogStreamingEventRelay', () => { eventName: 'n8n.workflow.success', payload: { ...rest, - success: true, + success: true, // same as finished isManual: true, workflowName: 'some-name', workflowId: 'some-id', @@ -161,10 +166,11 @@ describe('LogStreamingEventRelay', () => { }); }); - it('should log on `workflow-post-execute` event for unsuccessful execution', () => { + it('should log on `workflow-post-execute` event for failed execution', () => { const runData = mock({ status: 'error', mode: 'manual', + finished: false, data: { resultData: { lastNodeExecuted: 'some-node', @@ -193,7 +199,7 @@ describe('LogStreamingEventRelay', () => { eventName: 'n8n.workflow.failed', payload: { ...rest, - success: false, + success: false, // same as finished isManual: true, workflowName: 'some-name', workflowId: 'some-id', diff --git a/packages/cli/src/events/log-streaming-event-relay.ts b/packages/cli/src/events/log-streaming-event-relay.ts index 85d5a8cb8fb3c..2d79408d4a8c4 100644 --- a/packages/cli/src/events/log-streaming-event-relay.ts +++ b/packages/cli/src/events/log-streaming-event-relay.ts @@ -112,7 +112,7 @@ export class LogStreamingEventRelay extends EventRelay { const payload = { ...rest, - success: runData?.status === 'success', + success: !!runData?.finished, // despite the `success` name, this reports `finished` state isManual: runData?.mode === 'manual', workflowId: workflow.id, workflowName: workflow.name,