Table of Contents

Class WorkflowDefinition

Namespace
Temporalio.Workflows
Assembly
Temporalio.dll

Definition of a workflow.

public class WorkflowDefinition
Inheritance
WorkflowDefinition
Inherited Members

Properties

Dynamic

Gets a value indicating whether the workflow is dynamic.

public bool Dynamic { get; }

Property Value

bool

DynamicQuery

Gets the dynamic query for the workflow.

public WorkflowQueryDefinition? DynamicQuery { get; }

Property Value

WorkflowQueryDefinition

DynamicSignal

Gets the dynamic signal for the workflow.

public WorkflowSignalDefinition? DynamicSignal { get; }

Property Value

WorkflowSignalDefinition

DynamicUpdate

Gets the dynamic update for the workflow.

public WorkflowUpdateDefinition? DynamicUpdate { get; }

Property Value

WorkflowUpdateDefinition

FailureExceptionTypes

Gets the failure exception types. See FailureExceptionTypes for more details.

public Type[]? FailureExceptionTypes { get; }

Property Value

Type[]

Instantiable

Gets a value indicating whether the workflow type can be created and used in a worker.

public bool Instantiable { get; }

Property Value

bool

Name

Gets the workflow name or null if workflow is dynamic.

public string? Name { get; }

Property Value

string

Queries

Gets the queries for the workflow.

public IReadOnlyDictionary<string, WorkflowQueryDefinition> Queries { get; }

Property Value

IReadOnlyDictionary<string, WorkflowQueryDefinition>

RunMethod

Gets the workflow entry point.

public MethodInfo RunMethod { get; }

Property Value

MethodInfo

Signals

Gets the signals for the workflow.

public IReadOnlyDictionary<string, WorkflowSignalDefinition> Signals { get; }

Property Value

IReadOnlyDictionary<string, WorkflowSignalDefinition>

Type

Gets the workflow type.

public Type Type { get; }

Property Value

Type

Updates

Gets the updates for the workflow.

public IReadOnlyDictionary<string, WorkflowUpdateDefinition> Updates { get; }

Property Value

IReadOnlyDictionary<string, WorkflowUpdateDefinition>

Methods

Create(Type)

Create a workflow definition for the given type or fail. The result is cached by type.

public static WorkflowDefinition Create(Type type)

Parameters

type Type

Type to get definition for.

Returns

WorkflowDefinition

Definition for the type.

Create(Type, string?, Func<object?[], object>?)

Create a workflow with a custom creator. The result is not cached. Most users will use Create(Type) instead.

public static WorkflowDefinition Create(Type type, string? nameOverride, Func<object?[], object>? creatorOverride)

Parameters

type Type

Type to get definition for.

nameOverride string

The name to use instead of what may be on the attribute.

creatorOverride Func<object[], object>

If present, the method to use to create an instance of the workflow.

Returns

WorkflowDefinition

Definition for the type.

CreateWorkflowInstance(object?[])

Instantiate an instance of the workflow with the given run arguments.

public object CreateWorkflowInstance(object?[] workflowArguments)

Parameters

workflowArguments object[]

Arguments for workflow run.

Returns

object

The created workflow instance.

Create<T>()

Create a workflow definition for the given type or fail. The result is cached by type.

public static WorkflowDefinition Create<T>()

Returns

WorkflowDefinition

Definition for the type.

Type Parameters

T

Type to get definition for.