Cogito.Activities
3.1.10
dotnet add package Cogito.Activities --version 3.1.10
NuGet\Install-Package Cogito.Activities -Version 3.1.10
<PackageReference Include="Cogito.Activities" Version="3.1.10" />
<PackageVersion Include="Cogito.Activities" Version="3.1.10" />
<PackageReference Include="Cogito.Activities" />
paket add Cogito.Activities --version 3.1.10
#r "nuget: Cogito.Activities, 3.1.10"
#:package Cogito.Activities@3.1.10
#addin nuget:?package=Cogito.Activities&version=3.1.10
#tool nuget:?package=Cogito.Activities&version=3.1.10
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 | Versions 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. |
-
.NETFramework 4.6.1
- Cogito.Core (>= 3.1.37)
- System.Net.Http (>= 4.3.4)
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 |