Table of Contents

Class TemporalNexusClient

Namespace
Temporalio.Nexus
Assembly
Temporalio.dll

Nexus-aware client wrapping the Temporal client. Provides methods for starting workflows from within Nexus operation handlers, handling all Nexus plumbing (links, callbacks, token generation) internally.

public class TemporalNexusClient : ITemporalNexusClient
Inheritance
TemporalNexusClient
Implements
Inherited Members

Remarks

WARNING: Nexus support is experimental. This client is created by TemporalOperationHandler and passed to the user's start function. It should not be instantiated directly.

Properties

TemporalClient

Gets the underlying Temporal client for advanced use cases such as sending signals or queries.

public ITemporalClient TemporalClient { get; }

Property Value

ITemporalClient

Methods

StartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>>, WorkflowOptions)

Start a workflow via a lambda invoking the run method with no return value. Always returns an async result with a workflow-run operation token.

public Task<TemporalOperationResult<NoValue>> StartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>> workflowRunCall, WorkflowOptions options)

Parameters

workflowRunCall Expression<Func<TWorkflow, Task>>

Invocation of workflow run method with no result.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task<TemporalOperationResult<NoValue>>

An async operation result containing the workflow-run token.

Type Parameters

TWorkflow

Workflow class type.

StartWorkflowAsync<TResult>(string, IReadOnlyCollection<object?>, WorkflowOptions)

Start a workflow by name. Always returns an async result with a workflow-run operation token.

public Task<TemporalOperationResult<TResult>> StartWorkflowAsync<TResult>(string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)

Parameters

workflow string

Workflow type name.

args IReadOnlyCollection<object>

Arguments for the workflow.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task<TemporalOperationResult<TResult>>

An async operation result containing the workflow-run token.

Type Parameters

TResult

Workflow result type.

StartWorkflowAsync<TWorkflow, TResult>(Expression<Func<TWorkflow, Task<TResult>>>, WorkflowOptions)

Start a workflow via a lambda invoking the run method. Always returns an async result with a workflow-run operation token.

public Task<TemporalOperationResult<TResult>> StartWorkflowAsync<TWorkflow, TResult>(Expression<Func<TWorkflow, Task<TResult>>> workflowRunCall, WorkflowOptions options)

Parameters

workflowRunCall Expression<Func<TWorkflow, Task<TResult>>>

Invocation of workflow run method with a result.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task<TemporalOperationResult<TResult>>

An async operation result containing the workflow-run token.

Type Parameters

TWorkflow

Workflow class type.

TResult

Workflow result type.