mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Do not emit workflow-post-execute event for waiting executions (#13065)
This commit is contained in:
committed by
GitHub
parent
a37c8e8fb8
commit
1593b6cb41
@@ -126,6 +126,12 @@ describe('Execution Lifecycle Hooks', () => {
|
||||
workflow: workflowData,
|
||||
});
|
||||
});
|
||||
|
||||
it('should not emit workflow-post-execute events for waiting executions', async () => {
|
||||
await hooks.executeHookFunctions('workflowExecuteAfter', [waitingRun, {}]);
|
||||
|
||||
expect(eventService.emit).not.toHaveBeenCalledWith('workflow-post-execute');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@ function hookFunctionsWorkflowEvents(userId?: string): IWorkflowExecuteHooks {
|
||||
],
|
||||
workflowExecuteAfter: [
|
||||
async function (this: WorkflowHooks, runData: IRun): Promise<void> {
|
||||
if (runData.status === 'waiting') return;
|
||||
|
||||
const { executionId, workflowData: workflow } = this;
|
||||
eventService.emit('workflow-post-execute', { executionId, runData, workflow, userId });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user