Tempo.Sdk 0.3.1

dotnet add package Tempo.Sdk --version 0.3.1
                    
NuGet\Install-Package Tempo.Sdk -Version 0.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tempo.Sdk" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tempo.Sdk" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Tempo.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Tempo.Sdk --version 0.3.1
                    
#r "nuget: Tempo.Sdk, 0.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Tempo.Sdk@0.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tempo.Sdk&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Tempo.Sdk&version=0.3.1
                    
Install as a Cake Tool

Tempo C# SDK

Protocol v1 SDK for .NET artifact step handlers.

API

  • ProtocolVersions: protocol constants, supported versions, and launch environment variable names.
  • StepRequest: request envelope received from Tempo.
  • StepResult: result envelope returned to Tempo.
  • StepResultType: valid result states.
  • ITempoStepHandler: async handler interface.
  • ITempoStepLogger: ambient file-backed logger exposed during execution.
  • TempoExecutionContext.Current: ambient run, step, assignment, request, worker, and logger context.
  • TempoStepHandlerBase: base handler with result helpers and Log* methods.
  • TempoStepHost: JSON serialization, result helpers, correlation, and stdin/stdout runner.
  • Tempo.Sdk.Workers.*: worker-protocol frame DTOs and JSON options for building custom C# worker clients.

Handler

using Tempo.Sdk;

public sealed class Handler : TempoStepHandlerBase
{
    public override Task<StepResult> RunAsync(StepRequest request, CancellationToken token)
    {
        LogInfo("processing request " + request.RequestId);
        return Task.FromResult(Success(request, new { ok = true }));
    }
}

return await TempoStepHost.RunAsync(new Handler());

TempoStepHost.RunAsync reads one StepRequest JSON object from stdin and writes one StepResult JSON object to stdout. Helper results preserve protocolVersion, tenant, run, step-run, and request correlation fields.

Logging

Tempo reserves stdout for protocol JSON. Use the ambient logger instead of writing diagnostic output to stdout.

using Tempo.Sdk;

public sealed class Handler : TempoStepHandlerBase
{
    public override Task<StepResult> RunAsync(StepRequest request, CancellationToken token)
    {
        LogInfo("processing order");
        return Task.FromResult(Success(request, new { ok = true }));
    }
}

When TEMPO_RUN_LOG_FILE is present, TempoStepHost.RunAsync installs a file-backed logger and redirects Console.Out and Console.Error into the run-log file so protocol stdout remains clean.

New C# handlers should inherit TempoStepHandlerBase and use LogInfo, LogWarn, LogError, or TempoExecutionContext.Current.Logger. The host resolves TEMPO_RUN_LOG_FILE once per invocation; step code should not read the environment variable or call File.AppendAllText per log message.

Worker Protocol DTOs

The SDK also includes the v0.3.0 worker websocket DTOs under Tempo.Sdk.Workers:

  • WorkerProtocolJson
  • WorkerFrameTypes
  • WorkerHelloMessage
  • WorkerHelloAckMessage
  • WorkerHeartbeatMessage
  • WorkerAssignMessage
  • WorkerAssignAckMessage
  • WorkerRunCompletedMessage
  • WorkerDrainMessage
  • WorkerResumeMessage

WorkerAssignMessage.Assignment, WorkerAssignMessage.Plan, and WorkerRunCompletedMessage.Completion are exposed as raw JsonElement payloads so the SDK can stay aligned with the wire contract without taking a dependency on Tempo.Server or Tempo.Core orchestration types.

Test App

Run from the repository root:

dotnet run --project .\sdk\csharp\Tempo.Sdk.TestApp\Tempo.Sdk.TestApp.csproj

The test application reflects the public SDK surface and asserts every public symbol is covered by the test program.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 93 11/18/2026
0.2.1 161 4/21/2026