diff --git a/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuted.cs b/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuted.cs index 8f7e9b39a..016a6784a 100644 --- a/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuted.cs +++ b/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuted.cs @@ -7,4 +7,4 @@ namespace Elsa.Workflows.Core.Notifications; /// /// A domain event that is published everytime a burst of execution completes. /// -public record WorkflowExecuted(Workflow Workflow, WorkflowState WorkflowState) : INotification; \ No newline at end of file +public record WorkflowExecuted(Workflow Workflow, WorkflowState WorkflowState, WorkflowExecutionContext WorkflowExecutionContext) : INotification; \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuting.cs b/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuting.cs index 645b8c17e..ae3168508 100644 --- a/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuting.cs +++ b/src/modules/Elsa.Workflows.Core/Notifications/WorkflowExecuting.cs @@ -6,4 +6,4 @@ namespace Elsa.Workflows.Core.Notifications; /// /// A domain event that is published before a burst of execution begins. /// -public record WorkflowExecuting(Workflow Workflow) : INotification; \ No newline at end of file +public record WorkflowExecuting(Workflow Workflow, WorkflowExecutionContext WorkflowExecutionContext) : INotification; \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Core/Services/WorkflowRunner.cs b/src/modules/Elsa.Workflows.Core/Services/WorkflowRunner.cs index a8e4b1966..deaf4cb97 100644 --- a/src/modules/Elsa.Workflows.Core/Services/WorkflowRunner.cs +++ b/src/modules/Elsa.Workflows.Core/Services/WorkflowRunner.cs @@ -165,7 +165,7 @@ public class WorkflowRunner : IWorkflowRunner var cancellationToken = workflowExecutionContext.CancellationToken; // Publish domain event. - await _eventPublisher.PublishAsync(new WorkflowExecuting(workflow), cancellationToken); + await _eventPublisher.PublishAsync(new WorkflowExecuting(workflow, workflowExecutionContext), cancellationToken); // Transition into the Running state. workflowExecutionContext.TransitionTo(WorkflowSubStatus.Executing); @@ -182,7 +182,7 @@ public class WorkflowRunner : IWorkflowRunner var result = workflow.ResultVariable?.Get(workflowExecutionContext.MemoryRegister); // Publish domain event. - await _eventPublisher.PublishAsync(new WorkflowExecuted(workflow, workflowState), cancellationToken); + await _eventPublisher.PublishAsync(new WorkflowExecuted(workflow, workflowState, workflowExecutionContext), cancellationToken); // Return workflow execution result containing state + bookmarks. return new RunWorkflowResult(workflowState, workflowExecutionContext.Workflow, result);