Table of Contents

Class WorkflowDefinition

Namespace
Temporalio.Workflows
Assembly
Temporalio.dll

Definition of a workflow.

public class WorkflowDefinition
Inheritance
WorkflowDefinition
Inherited Members

Properties

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.

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

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.

FromRunMethod(MethodInfo)

Get the workflow definition for the type the given run method is on. Expects the method to have WorkflowRunAttribute.

public static WorkflowDefinition FromRunMethod(MethodInfo runMethod)

Parameters

runMethod MethodInfo

Workflow run method.

Returns

WorkflowDefinition

Workflow definition for the type the run method is on.