Fleans.ExternalTasks.Sdk 0.11.0

dotnet add package Fleans.ExternalTasks.Sdk --version 0.11.0
                    
NuGet\Install-Package Fleans.ExternalTasks.Sdk -Version 0.11.0
                    
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="Fleans.ExternalTasks.Sdk" Version="0.11.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fleans.ExternalTasks.Sdk" Version="0.11.0" />
                    
Directory.Packages.props
<PackageReference Include="Fleans.ExternalTasks.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 Fleans.ExternalTasks.Sdk --version 0.11.0
                    
#r "nuget: Fleans.ExternalTasks.Sdk, 0.11.0"
                    
#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 Fleans.ExternalTasks.Sdk@0.11.0
                    
#: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=Fleans.ExternalTasks.Sdk&version=0.11.0
                    
Install as a Cake Addin
#tool nuget:?package=Fleans.ExternalTasks.Sdk&version=0.11.0
                    
Install as a Cake Tool

Fleans.ExternalTasks.Sdk

Write Fleans custom-task workers — the code behind <bpmn:serviceTask type="…">. A worker process built on this package is a plain .NET generic host that connects to a Fleans API over gRPC (or gRPC-Web): it receives the tasks of the types it implements, runs them, and reports the outcome. It joins no Orleans cluster, so it needs no clustering, streaming or reminder configuration — only the API's URL. The package has no Orleans dependency, direct or transitive.

Minimum worker

using System.Dynamic;
using Fleans.ExternalTasks.Sdk;

public sealed class MyHandler(IHttpClientFactory http) : ExternalTaskHandler
{
    public override async Task<IDictionary<string, object?>> ExecuteAsync(
        IDictionary<string, object?> resolvedInputs,   // the task's evaluated input mappings
        ExpandoObject variables,                         // workflow variables visible to the task
        ExternalTaskContext context,              // ids; ActivityInstanceId = idempotency key
        CancellationToken cancellationToken)
    {
        if (!resolvedInputs.ContainsKey("orderId"))
            throw new ExternalTaskFailedException("MISSING_ORDER", "orderId is required"); // BPMN error code
        // ... your work ...
        return new Dictionary<string, object?> { ["__response"] = new { ok = true } };
    }
}

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddFleansExternalTaskWorker();                       // binds Fleans:ExternalTaskWorker
builder.Services.AddExternalTaskHandler<MyHandler>("my-task", displayName: "My Task");
builder.Build().Run();
Fleans__ExternalTaskWorker__EngineUrl=http://fleans-api:8080 dotnet run

Configuration (Fleans:ExternalTaskWorker)

Key Default
EngineUrl — (required) The Fleans API base URL.
WorkerName {machine}-{pid} Shown in the custom-task catalog; unique per process.
UseGrpcWeb true gRPC-Web over HTTP/1.1 works against any API endpoint and proxy. Set false for native gRPC when the endpoint speaks HTTP/2 (TLS, or Kestrel Protocols=Http2).
AccessToken — Bearer token for an API with Authentication:Authority set (or set AccessTokenProvider in code).
MaxConcurrentTasks 32 Tasks run at once; further assignments wait in-process.
ReconnectDelay 5s Pause before re-subscribing after the connection drops.

Delivery contract

  • At-least-once: handlers must be idempotent. A task whose worker disconnects, crashes, or exceeds the engine's Fleans:ExternalTasks:ExecutionTimeout is delivered again — possibly to another worker. Key external side effects by context.ActivityInstanceId, which stays the same across deliveries.
  • No connected worker. The task waits, within the engine's stream delivery window (Fleans:Streaming:MaxEventDeliveryTime, 6 minutes by default). Past it the engine stops offering the task, and the activity stays active until reported over REST.
  • Failures. ExternalTaskFailedException(code, message) fails the activity with that BPMN error code (catchable by an error boundary event); any other exception fails it with 500.
  • Cancellation is not failure. The token fires when the engine stops waiting (timeout, shutdown), the connection drops, or the host stops. The task is not reported and is delivered again. After a dropped connection the worker re-subscribes after ReconnectDelay.
  • Deferring. Return ExternalTaskHandler.Deferred when the outcome comes later: the activity stays active, with no timeout, until POST /Execution/complete-activity or fail-activity quotes context.ActivityInstanceId. A redelivery can still run the handler again, so record the task idempotently first.
  • Wildcards. AddExternalTaskHandler<T>("<scheme>:*") claims every <scheme>:… type no worker claims exactly. A wildcard is not listed in the catalog.
  • Editor metadata. parameterSchema (ExternalTaskParameterSchema) renders typed inputs; category, visibility (ExternalTaskVisibility) and allowedProcessKeys work as in the catalog.
  • Inputs, variables and the result cross the wire as JSON.

Other languages: generate a client from protos/external_task_worker.proto, shipped in this package (src/Fleans/Fleans.ExternalTasks.Sdk/Protos/).

See the external workers guide.

Product Compatible and additional computed target framework versions.
.NET 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 (2)

Showing the top 2 NuGet packages that depend on Fleans.ExternalTasks.Sdk:

Package Downloads
Fleans.Plugins.RestCaller

Fleans REST caller plugin — backs <serviceTask type="rest-call"> with an HTTP request.

Fleans.Plugins.CamundaExternalTask

Fleans Camunda 7 External Task compatibility plugin — queues <serviceTask type="camunda:topic"> in a table and serves the Camunda 7 /external-task REST API so existing external-task workers keep working unchanged.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.11.0 0 11/6/2026