Cogito.Activities 3.1.10

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

Cogito.Activities

Async and retry support for Windows Workflow Foundation, plus a set of activities that make WF usable from ordinary C#.

Why

WF predates async/await, so calling an async API from an activity means writing an AsyncCodeActivity with Begin/End pairs by hand. Retry is likewise something every workflow reinvents. This package provides both, and a fluent way to build activities from delegates instead of constructing expression trees.

Install

dotnet add package Cogito.Activities

Awaiting inside an activity

var activity = Expressions.Invoke(async () => await client.GetOrderAsync(id));

AsyncTaskCodeActivity is the base if you are writing your own. The task runs on an AsyncTaskExecutor, so the workflow's scheduler is not blocked; WithAsyncTaskExecutor chooses which executor a scope uses, and ThreadPoolAsyncTaskExecutor is the default.

Retrying

var activity = new Retry
{
    Body = DoTheWork(),
}
.WithAttempts(5)
.WithDelay(TimeSpan.FromSeconds(10));

RetryCatch narrows which exceptions are retried, and each caught attempt is emitted as a RetryExceptionCaughtTrackingRecord so retries show up in tracking rather than disappearing.

Driving a workflow

Extension methods give the WorkflowApplication API an async face — RunAsync, LoadAsync, UnloadAsync, PersistAsync, ResumeBookmarkAsync, WaitForCompletionAsync.

NoPersist / WithNoPersist mark a region as non-persistable; For, Branch, BranchWait, AndAlso and FormatActivity cover common shapes without hand-built expressions.

Targets .NET Framework — WF only exists there.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cogito.Activities:

Package Downloads
Cogito.ServiceFabric.Activities

Microsoft Service Fabric infrastructure for running Windows Workflows within an Actor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.10 0 11/28/2026
3.1.9 186 9/14/2026
3.1.8 116 9/14/2026
3.1.7 1,038 8/7/2020
3.1.4 720 8/7/2020
3.1.1 868 2/7/2020
3.0.7 820 1/17/2020
3.0.4 816 10/17/2019
3.0.1 784 10/17/2019
3.0.0 1,191 10/25/2018
2.1.0-unstable0037 972 8/22/2018
2.1.0-unstable0035 1,161 7/10/2018
2.1.0-unstable0013 1,159 9/4/2017
2.1.0-unstable0012 1,169 9/4/2017
2.1.0-unstable0002 1,132 8/30/2017
2.0.0 1,885 8/27/2017
2.0.0-unstable0030 1,195 8/27/2017
2.0.0-unstable0028 1,179 8/26/2017
1.1.0-unstable0007 1,216 3/27/2017
1.1.0-unstable0006 1,212 3/27/2017
Loading failed