Table of Contents

Class WorkflowWorkItem

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

A serializable unit of work enqueued for distributed workflow execution.

public sealed record WorkflowWorkItem : IEquatable<WorkflowWorkItem>
Inheritance
WorkflowWorkItem
Implements
Inherited Members

Properties

CorrelationId

Correlation ID used for distributed tracing (OTel TraceId linking).

[JsonPropertyName("correlationId")]
public string CorrelationId { get; init; }

Property Value

string

DeliveryCount

Number of delivery attempts. Incremented by the worker on each retry.

[JsonPropertyName("deliveryCount")]
public int DeliveryCount { get; init; }

Property Value

int

EnqueuedAt

When the item was enqueued.

[JsonPropertyName("enqueuedAt")]
public DateTimeOffset EnqueuedAt { get; init; }

Property Value

DateTimeOffset

Id

Unique identifier for this work item.

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

InitialContext

Initial context passed to the workflow.

[JsonPropertyName("initialContext")]
public IDictionary<string, string> InitialContext { get; init; }

Property Value

IDictionary<string, string>

MaxDeliveryCount

Maximum delivery attempts before dead-lettering.

[JsonPropertyName("maxDeliveryCount")]
public int MaxDeliveryCount { get; init; }

Property Value

int

Priority

Execution priority (0 = highest).

[JsonPropertyName("priority")]
public int Priority { get; init; }

Property Value

int

WorkflowName

Name of the workflow to execute.

[JsonPropertyName("workflowName")]
public required string WorkflowName { get; init; }

Property Value

string

WorkflowVersion

Requested workflow version. null means latest.

[JsonPropertyName("workflowVersion")]
public string? WorkflowVersion { get; init; }

Property Value

string