n8n/packages/cli/src/events/index.ts
freya 1722c6b0c5
feat(core): Workflow Execution Statistics (#4200)
Add recording and reporting of workflow execution statistics
2022-12-06 14:55:40 +00:00

8 lines
432 B
TypeScript

import { eventEmitter } from 'n8n-core';
import { nodeFetchedData, workflowExecutionCompleted } from './WorkflowStatistics';
// Check for undefined as during testing these functions end up undefined for some reason
if (nodeFetchedData) eventEmitter.on(eventEmitter.types.nodeFetchedData, nodeFetchedData);
if (workflowExecutionCompleted)
eventEmitter.on(eventEmitter.types.workflowExecutionCompleted, workflowExecutionCompleted);