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
Name
Gets the workflow name.
public string Name { get; }
Property Value
Queries
Gets the queries for the workflow.
public IReadOnlyDictionary<string, WorkflowQueryDefinition> Queries { get; }
Property Value
RunMethod
Gets the workflow entry point.
public MethodInfo RunMethod { get; }
Property Value
Signals
Gets the signals for the workflow.
public IReadOnlyDictionary<string, WorkflowSignalDefinition> Signals { get; }
Property Value
Type
Gets the workflow type.
public Type Type { get; }
Property Value
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
TypeType 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
TypeType to get definition for.
nameOverride
stringThe 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
MethodInfoWorkflow run method.
Returns
- WorkflowDefinition
Workflow definition for the type the run method is on.