2
2
3
3
import {
4
4
ActiveWorkflows ,
5
+ ErrorReporter ,
5
6
InstanceSettings ,
6
7
NodeExecuteFunctions ,
7
8
PollContext ,
@@ -25,7 +26,6 @@ import type {
25
26
import {
26
27
Workflow ,
27
28
WorkflowActivationError ,
28
- ErrorReporterProxy as ErrorReporter ,
29
29
WebhookPathTakenError ,
30
30
ApplicationError ,
31
31
} from 'n8n-workflow' ;
@@ -41,10 +41,12 @@ import {
41
41
import type { WorkflowEntity } from '@/databases/entities/workflow-entity' ;
42
42
import { WorkflowRepository } from '@/databases/repositories/workflow.repository' ;
43
43
import { OnShutdown } from '@/decorators/on-shutdown' ;
44
+ import { ExecutionService } from '@/executions/execution.service' ;
44
45
import { ExternalHooks } from '@/external-hooks' ;
45
46
import type { IWorkflowDb } from '@/interfaces' ;
46
47
import { Logger } from '@/logging/logger.service' ;
47
48
import { NodeTypes } from '@/node-types' ;
49
+ import { Publisher } from '@/scaling/pubsub/publisher.service' ;
48
50
import { ActiveWorkflowsService } from '@/services/active-workflows.service' ;
49
51
import { OrchestrationService } from '@/services/orchestration.service' ;
50
52
import * as WebhookHelpers from '@/webhooks/webhook-helpers' ;
@@ -53,9 +55,6 @@ import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-da
53
55
import { WorkflowExecutionService } from '@/workflows/workflow-execution.service' ;
54
56
import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service' ;
55
57
56
- import { ExecutionService } from './executions/execution.service' ;
57
- import { Publisher } from './scaling/pubsub/publisher.service' ;
58
-
59
58
interface QueuedActivation {
60
59
activationMode : WorkflowActivateMode ;
61
60
lastTimeout : number ;
@@ -69,6 +68,7 @@ export class ActiveWorkflowManager {
69
68
70
69
constructor (
71
70
private readonly logger : Logger ,
71
+ private readonly errorReporter : ErrorReporter ,
72
72
private readonly activeWorkflows : ActiveWorkflows ,
73
73
private readonly activeExecutions : ActiveExecutions ,
74
74
private readonly externalHooks : ExternalHooks ,
@@ -205,7 +205,7 @@ export class ActiveWorkflowManager {
205
205
try {
206
206
await this . clearWebhooks ( workflow . id ) ;
207
207
} catch ( error1 ) {
208
- ErrorReporter . error ( error1 ) ;
208
+ this . errorReporter . error ( error1 ) ;
209
209
this . logger . error (
210
210
`Could not remove webhooks of workflow "${ workflow . id } " because of error: "${ error1 . message } "` ,
211
211
) ;
@@ -439,7 +439,7 @@ export class ActiveWorkflowManager {
439
439
this . logger . info ( ' => Started' ) ;
440
440
}
441
441
} catch ( error ) {
442
- ErrorReporter . error ( error ) ;
442
+ this . errorReporter . error ( error ) ;
443
443
this . logger . info (
444
444
' => ERROR: Workflow could not be activated on first try, keep on trying if not an auth issue' ,
445
445
) ;
@@ -635,7 +635,7 @@ export class ActiveWorkflowManager {
635
635
try {
636
636
await this . add ( workflowId , activationMode , workflowData ) ;
637
637
} catch ( error ) {
638
- ErrorReporter . error ( error ) ;
638
+ this . errorReporter . error ( error ) ;
639
639
let lastTimeout = this . queuedActivations [ workflowId ] . lastTimeout ;
640
640
if ( lastTimeout < WORKFLOW_REACTIVATE_MAX_TIMEOUT ) {
641
641
lastTimeout = Math . min ( lastTimeout * 2 , WORKFLOW_REACTIVATE_MAX_TIMEOUT ) ;
@@ -707,7 +707,7 @@ export class ActiveWorkflowManager {
707
707
try {
708
708
await this . clearWebhooks ( workflowId ) ;
709
709
} catch ( error ) {
710
- ErrorReporter . error ( error ) ;
710
+ this . errorReporter . error ( error ) ;
711
711
this . logger . error (
712
712
`Could not remove webhooks of workflow "${ workflowId } " because of error: "${ error . message } "` ,
713
713
) ;
@@ -724,7 +724,7 @@ export class ActiveWorkflowManager {
724
724
try {
725
725
await this . clearWebhooks ( workflowId ) ;
726
726
} catch ( error ) {
727
- ErrorReporter . error ( error ) ;
727
+ this . errorReporter . error ( error ) ;
728
728
this . logger . error (
729
729
`Could not remove webhooks of workflow "${ workflowId } " because of error: "${ error . message } "` ,
730
730
) ;
0 commit comments