Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/develop/dotnet/temporal-nexus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,25 @@ This will show the two workflows started and their results.

### Canceling a Nexus Operation {#canceling-a-nexus-operation}

<!--TODO: Add .NET cancellation type information (like Java) once available -->

To cancel a Nexus Operation from within a Workflow, cancel the cancellation token passed to the operation call. Only asynchronous operations can be canceled in Nexus, since cancellation is sent using an operation token.
The Workflow or other resources backing the operation may choose to ignore the cancellation request.
If ignored, the operation may enter a terminal state.

When a Nexus operation is started, the caller can specify different cancellation types that control how the caller reacts to cancellation:

- `Abandon` - Do not request cancellation of the operation.
- `TryCancel` - Initiate a cancellation request and immediately report cancellation to the caller. Note that this type doesn't guarantee that cancellation is delivered to the operation handler if the caller exits before the delivery is done.
- `WaitCancellationRequested` ` Request cancellation of the operation and wait for confirmation that the request was received. Doesn't wait for actual cancellation.
- `WaitCancellationCompleted` - Wait for operation completion. Operation may or may not complete as cancelled.

The default is `WaitCancellationCompleted`. Users can set a different option for `CancellationType` in `NexusOperationOptions` when starting an operation.

Once the caller Workflow completes, the caller's Nexus Machinery will not make any further attempts to cancel operations that are still running.
It's okay to leave operations running in some use cases.
To ensure cancellations are delivered, wait for all pending operations to finish before exiting the Workflow.

See the [Nexus cancellation sample](https://github.com/temporalio/samples-dotnet/tree/main/src/NexusCancellation) for reference.

## Make Nexus calls across Namespaces in Temporal Cloud {#nexus-calls-across-namespaces-temporal-cloud}

This section assumes you are already familiar with how to connect a Worker to Temporal Cloud.
Expand Down