Jint.Workflows 0.2.0

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

Jint.Workflows

FoundatioFoundatio

Build status NuGet Version feedz.io Discord

Durable JavaScript workflows for .NET using Jint. Write long-running orchestration logic as async JavaScript, suspend execution at any await, serialize the state, and resume later β€” potentially days later, in a different process. Uses deterministic replay on top of Jint's public API, with zero engine modifications.

Influenced by Vercel's Workflow SDK, adapted for the .NET / Jint environment.

✨ Features

  • πŸ’Ύ Tiny, portable state β€” serialized state is a compact JSON journal of results; store it anywhere
  • ⏳ Suspend for days β€” pause at any await, persist, resume in a different process
  • πŸ” Deterministic replay β€” Date.now(), new Date(), Math.random() overridden for stable replays
  • πŸ›‘οΈ Journaled side effects β€” step functions execute once and replay from cache
  • 🩹 Policy-based retries β€” attach Foundatio.Resilience policies for in-process retry, or throw RetryableStepException for durable cross-restart retries
  • 🌐 Browser-compatible fetch β€” opt-in WHATWG fetch with .json(), .text(), .clone()
  • πŸ“£ Named external events β€” waitForEvent('name') single or multi-event, with timeout support
  • πŸ”€ Fan-out/fan-in β€” Promise.all and Promise.race over steps and suspends
  • ♾️ Continue As New β€” restart with a fresh journal to avoid unbounded growth
  • πŸ› οΈ Journal compatibility check β€” script drift fails fast with a clear diagnostic

πŸš€ Get Started

dotnet add package Jint.Workflows
using Jint.Workflows;

var workflow = new WorkflowEngine();
workflow.RegisterSuspendFunction("sleep", args => DurationParser.Parse(args[0]));
workflow.RegisterStepFunction("fetchOrder", args => orderService.GetOrder((string)args[0]!));
workflow.RegisterSuspendFunction("getApproval");

var script = """
    async function processOrder(orderId) {
        const order = await fetchOrder(orderId);
        await sleep('3d');
        const approved = await getApproval('manager', orderId);
        return approved ? 'shipped' : 'cancelled';
    }
""";

var result = workflow.RunWorkflow(script, "processOrder", "ORD-001");
// result.Status == Suspended, result.Suspension.ResumeAt β‰ˆ 3 days from now

var json = result.State!.Serialize();  // persist anywhere

// ... 3 days later, in a different process
var resumed = workflow.ResumeWorkflow(script, json);

πŸ‘‰ Getting Started Guide β€” step-by-step setup, step functions, suspend functions, and replay.

πŸ“– Complete Documentation

πŸ“¦ CI Packages (Feedz)

Want the latest CI build before it hits NuGet? Add the Feedz source (read-only public) and install the pre-release version:

dotnet nuget add source https://f.feedz.io/foundatio/foundatio/nuget -n foundatio-feedz
dotnet add package Jint.Workflows --prerelease

Or add to your NuGet.config:

<configuration>
    <packageSources>
        <add key="foundatio-feedz" value="https://f.feedz.io/foundatio/foundatio/nuget" />
    </packageSources>
    <packageSourceMapping>
        <packageSource key="foundatio-feedz">
            <package pattern="Foundatio.*" />
            <package pattern="Jint.Workflows" />
        </packageSource>
    </packageSourceMapping>
</configuration>

🀝 Contributing

Contributions are welcome! See the documentation for how the engine works and what edits are safe across versions.

  • Jint β€” the JavaScript interpreter this library is built on
  • Vercel Workflow SDK β€” the primary source of inspiration for the replay-based durable workflow model
  • Azure Durable Functions β€” canonical .NET implementation of the deterministic replay pattern
  • Temporal / Restate β€” full workflow runtimes with the same replay model at a larger scope

πŸ“„ License

Apache-2.0 License

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

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.2.0 2,132 4/20/2026
0.1.0 135 4/19/2026