File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
services/workflows-service/src Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ export class WebhooksService {
25
25
endUserId : string ;
26
26
data : IndividualAmlWebhookInput [ 'data' ] ;
27
27
} ) {
28
+ this . logger . log ( 'Started handling individual AML hit' , { endUserId } ) ;
29
+
28
30
const { projectId, ...rest } = await this . endUserRepository . findByIdUnscoped ( endUserId , {
29
31
select : {
30
32
approvalState : true ,
@@ -85,10 +87,12 @@ export class WebhooksService {
85
87
} ) ;
86
88
87
89
if ( hits . length === 0 ) {
90
+ this . logger . log ( 'No AML hits found' , { endUserId } ) ;
91
+
88
92
return ;
89
93
}
90
94
91
- await this . workflowService . createOrUpdateWorkflowRuntime ( {
95
+ const workflow = await this . workflowService . createOrUpdateWorkflowRuntime ( {
92
96
workflowDefinitionId,
93
97
context : {
94
98
aml : data ,
@@ -105,5 +109,7 @@ export class WebhooksService {
105
109
projectIds : [ projectId ] ,
106
110
currentProjectId : projectId ,
107
111
} ) ;
112
+
113
+ this . logger . log ( `Created workflow for AML hits` , { workflow } ) ;
108
114
}
109
115
}
Original file line number Diff line number Diff line change @@ -1352,6 +1352,11 @@ export class WorkflowService {
1352
1352
const result = ConfigSchema . safeParse ( config ) ;
1353
1353
1354
1354
if ( ! result . success ) {
1355
+ this . logger . error ( 'Invalid workflow config' , {
1356
+ config,
1357
+ error : result . error ,
1358
+ } ) ;
1359
+
1355
1360
throw ValidationError . fromZodError ( result . error ) ;
1356
1361
}
1357
1362
You can’t perform that action at this time.
0 commit comments