@@ -29,7 +29,10 @@ IWorkflowService workflowService
2929 [ Route ( "{workflowId:guid}/started" ) ]
3030 [ ProducesResponseType ( StatusCodes . Status204NoContent ) ]
3131 [ ProducesResponseType ( StatusCodes . Status404NotFound ) ]
32- public async Task < IActionResult > WorkflowStarted ( [ FromRoute ] Guid workflowId )
32+ public async Task < IActionResult > WorkflowStarted (
33+ [ FromRoute ] Guid workflowId ,
34+ [ FromBody ] WorkflowStartedNotification ? notification = null
35+ )
3336 {
3437 var workflow = await context . Workflows . FirstOrDefaultAsync ( w => w . Id == workflowId ) ;
3538 if ( workflow is null )
@@ -38,13 +41,18 @@ public async Task<IActionResult> WorkflowStarted([FromRoute] Guid workflowId)
3841 }
3942
4043 logger . LogInformation (
41- "Workflow {WorkflowType} (Id: {WorkflowId}) reported started" ,
44+ "Workflow {WorkflowType} (Id: {WorkflowId}) reported started (ArgoWorkflowName: {ArgoWorkflowName}) " ,
4245 workflow . WorkflowType ,
43- workflow . Id
46+ workflow . Id ,
47+ notification ? . ArgoWorkflowName
4448 ) ;
4549
4650 workflow . Status = WorkflowStatus . InProgress ;
4751 workflow . StartedAt = DateTime . UtcNow ;
52+ if ( ! string . IsNullOrWhiteSpace ( notification ? . ArgoWorkflowName ) )
53+ {
54+ workflow . ArgoWorkflowName = notification . ArgoWorkflowName ;
55+ }
4856 await context . SaveChangesAsync ( ) ;
4957
5058 return NoContent ( ) ;
@@ -134,6 +142,11 @@ [FromBody] WorkflowExitedNotification notification
134142 }
135143}
136144
145+ public class WorkflowStartedNotification
146+ {
147+ public string ? ArgoWorkflowName { get ; set ; }
148+ }
149+
137150public class WorkflowResultNotification
138151{
139152 public string ? ResultJson { get ; set ; }
0 commit comments