TemporalCommunity.DurableObjects
0.6.0
Prefix Reserved
dotnet add package TemporalCommunity.DurableObjects --version 0.6.0
NuGet\Install-Package TemporalCommunity.DurableObjects -Version 0.6.0
<PackageReference Include="TemporalCommunity.DurableObjects" Version="0.6.0" />
<PackageVersion Include="TemporalCommunity.DurableObjects" Version="0.6.0" />
<PackageReference Include="TemporalCommunity.DurableObjects" />
paket add TemporalCommunity.DurableObjects --version 0.6.0
#r "nuget: TemporalCommunity.DurableObjects, 0.6.0"
#:package TemporalCommunity.DurableObjects@0.6.0
#addin nuget:?package=TemporalCommunity.DurableObjects&version=0.6.0
#tool nuget:?package=TemporalCommunity.DurableObjects&version=0.6.0
TemporalCommunity.Extensions
Community-built extensions and compile-time guardrails for the Temporal .NET SDK.
Which offering fits?
| If you want to... | Start here |
|---|---|
| Create a plain Temporal .NET worker or a Worker + Client + Shared solution | Generate and run a template solution |
| Add replay-safety checks to ordinary Temporal workflows | Inspect the general analyzer examples |
| Model a long-lived entity with a stable ID and serialized updates | Run the Durable Objects page-counter demo |
Packages
| Package | Purpose |
|---|---|
TemporalCommunity.Templates |
dotnet new templates for Temporal workflows, activities, workers, and Worker + Client + Shared solutions, with optional Aspire and OpenTelemetry. |
TemporalCommunity.Extensions.Analyzers |
Replay-safety analyzers and code fixes for ordinary Temporal .NET workflows. |
TemporalCommunity.DurableObjects |
An opinionated durable-actor model for long-lived entities addressed by stable ID. |
TemporalCommunity.DurableObjects.Analyzers |
Durable Objects contract analyzers, code fixes, and generated asynchronous clients. |
Temporal workflow analyzers
Add compile-time checks to any Temporal .NET workflow project:
dotnet add package TemporalCommunity.Extensions.Analyzers
The package detects replay-safety and workflow-shape misuse in ordinary Temporal workflows, with IDE code fixes where a deterministic replacement is safe. These diagnostics also work in projects that do not reference the Durable Objects runtime.
See Temporal .NET Analyzers for installation details, the full rule catalog, code-fix behavior, limitations, and Durable Objects generator requirements.
Durable Objects
TemporalCommunity.DurableObjects is for entity-style workflows such as accounts, devices,
sessions, etc. It adds start-on-first-update through Update-with-Start, fire-and-forget signals
through Signal-with-Start, shared update/signal serialization, contained handler failures, and
typed state across Continue-as-New. Signal completion acknowledges server recording, not
handler completion; use updates when the caller needs acceptance, a result, or an error.
Use a plain Temporal workflow when the execution represents a process with a defined end or needs child workflows, orchestration-heavy control flow, or unrestricted SDK behavior. See Durable Objects concepts for the detailed comparison and lifecycle model.
Install
dotnet add package TemporalCommunity.DurableObjects
dotnet add package TemporalCommunity.Extensions.Analyzers
dotnet add package TemporalCommunity.DurableObjects.Analyzers
Requires Temporal Server v1.30.0 or later. The runtime targets .NET 10, .NET 8, and .NET Standard 2.1. .NET Standard does not support visibility-listing APIs.
Minimal example
This is a conceptual sketch of the Durable Objects programming model, not a complete runnable application. For the full worker and caller setup, run sample 01.
Define a contract and implementation:
using Temporalio.Workflows;
using TemporalCommunity.DurableObjects;
[Workflow]
public interface ICounter : IDurableObject
{
[WorkflowUpdate] Task<int> IncrementAsync(int amount);
[WorkflowQuery] int GetCount();
}
[Workflow]
public sealed class Counter : DurableObjectBase<int>, ICounter
{
[WorkflowInit]
public Counter(DurableObjectSnapshot<int>? snapshot = null) : base(snapshot, 0) { }
[WorkflowRun]
public Task RunAsync(DurableObjectSnapshot<int>? snapshot = null) => DurableObjectRunAsync();
[WorkflowUpdate]
public Task<int> IncrementAsync(int amount)
{
State += amount;
return Task.FromResult(State);
}
[WorkflowQuery]
public int GetCount() => State;
}
This example calls Durable Objects and runs the worker in the same process, so it registers both sides.
AddDurableObjectsprovides the client-sideIDurableObjectFactoryand its default task queue.AddDurableObjectWorkflowsregisters the object workflows and Durable Objects runtime on the worker.
If callers and workers run in separate services, each service registers only the side it uses; their task-queue names must match.
services.AddTemporalClient(options => options.TargetHost = "localhost:7233");
// Caller side: register the factory used to get Durable Object clients.
services.AddDurableObjects("my-task-queue");
// Worker side: register object workflows and their runtime behavior.
services.AddHostedTemporalWorker("my-task-queue")
.AddDurableObjectWorkflows(typeof(Counter).Assembly);
Use the concrete client generated by TemporalCommunity.DurableObjects.Analyzers:
var counter = factory.GetCounterClient("counter-42");
await counter.IncrementAsync(5);
var current = await counter.GetCountAsync();
IncrementAsync(5) is a workflow update. If counter-42 is not running, Update-with-Start starts
the object and submits the increment in one operation. Its state is rebuilt from Temporal history
after worker restarts and carried through Continue-as-New by DurableObjectBase<TState>.
Start with the runnable getting-started sample and the Durable Objects starting path for validators, activities, lifecycle behavior, failure handling, and production guidance.
Samples
Six runnable Durable Objects samples cover generated clients, validation, scheduling and reminders, object-to-object calls through activities, observability, and testing. See the samples index or the repository-wide getting-started paths.
For the Durable Objects demos, start a local Temporal server and run sample 01:
temporal server start-dev
just run-sample
Documentation
Start with Getting started to choose a path for templates, analyzers, or Durable Objects.
Templates and analyzers
- Temporal .NET templates: Generate workflows, activities, converters,
workers, or solutions with
dotnet new. - Temporal .NET analyzers: Install replay-safety and Durable Objects checks, explore code fixes, and use generated Durable Objects clients.
Durable Objects
- Concepts and API: Decide when to use Durable Objects and learn their identity, state, updates, scheduling, and API.
- Lifecycle and deactivation: Understand when an object stays resident, when it closes, and how history is compacted. This guide calls those choices "tiers."
- Failure handling: Handle client and lifecycle failures, authorization, and reminder retries.
- Troubleshooting: Diagnose common worker, query, scheduling, and configuration problems.
Building from source
Prerequisites: .NET 10 SDK and
just.
dotnet tool restore
just build
just test
Run just to list all recipes. Samples 01–05 use an external Temporal server (by default at
localhost:7233); sample 06 starts an SDK-managed local server; analyzer samples 07–08 need no
server. Full package verification (just pack-verify) and the local
CI-equivalent (just ci) use Unix/Bash tooling and are supported on Linux and macOS. On Windows,
after dotnet tool restore, run just test-unit from PowerShell 7 (pwsh); that recipe uses
PowerShell-safe single-line dotnet test commands. GitHub Actions repeats the build and tests on
Windows and runs package verification on Ubuntu.
Contributing
- Fork and clone the repository.
- Run
dotnet tool restoreonce. - Before opening a pull request, run
just cion Linux/macOS orjust test-uniton Windows. - Add or update meaningful tests and user documentation when behavior changes.
- Document current behavior and compatibility constraints in the relevant guide under
docs/.
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- System.Collections.Immutable (>= 10.0.1)
- Temporalio (>= 1.16.0)
- Temporalio.Extensions.Hosting (>= 1.16.0)
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Temporalio (>= 1.16.0)
- Temporalio.Extensions.Hosting (>= 1.16.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Temporalio (>= 1.16.0)
- Temporalio.Extensions.Hosting (>= 1.16.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.