Table of Contents

Class WorkflowExecutionCapture

Namespace
JD.AI.Workflows
Assembly
JD.AI.Workflows.dll

Captures step-level execution events during a workflow run. Implements WorkflowFramework.IWorkflowEvents for direct integration with IWorkflowBuilder<T>.WithEvents.

public sealed class WorkflowExecutionCapture : WorkflowEventsBase, IWorkflowEvents
Inheritance
WorkflowEventsBase
WorkflowExecutionCapture
Implements
IWorkflowEvents
Inherited Members
WorkflowEventsBase.OnWorkflowStartedAsync(IWorkflowContext)
WorkflowEventsBase.OnWorkflowCompletedAsync(IWorkflowContext)

Properties

CompletedCount

public int CompletedCount { get; }

Property Value

int

Events

public IReadOnlyList<StepEvent> Events { get; }

Property Value

IReadOnlyList<StepEvent>

FailedCount

public int FailedCount { get; }

Property Value

int

Methods

OnStepCompletedAsync(IWorkflowContext, IStep)

Called when a step completes successfully.

public override Task OnStepCompletedAsync(IWorkflowContext context, IStep step)

Parameters

context IWorkflowContext

The workflow context.

step IStep

The step that completed.

Returns

Task

A task representing the asynchronous operation.

OnStepFailedAsync(IWorkflowContext, IStep, Exception)

Called when a step fails.

public override Task OnStepFailedAsync(IWorkflowContext context, IStep step, Exception exception)

Parameters

context IWorkflowContext

The workflow context.

step IStep

The step that failed.

exception Exception

The exception that was thrown.

Returns

Task

A task representing the asynchronous operation.

OnStepStartedAsync(IWorkflowContext, IStep)

Called when a step starts.

public override Task OnStepStartedAsync(IWorkflowContext context, IStep step)

Parameters

context IWorkflowContext

The workflow context.

step IStep

The step about to execute.

Returns

Task

A task representing the asynchronous operation.