WJb Docs - Basic

Start here with installation, quick starts, and core concepts.

πŸš€ Start Here
✨ First Steps
βœ… Next Steps

🌊 First Workflow

A workflow is simply a chain of Actions.

Each Action decides what should run next.


Create two Actions

using WJb;

public sealed class GreetAction : JobAction<string> { public override Task<IActionResult> ExecuteAsync( string name, CancellationToken ct) { Console.WriteLine($"Hello, {name}!"); return NextAsync<LogAction>($"Greeted {name}"); } }

public sealed class LogAction : JobAction<string> { public override Task<IActionResult> ExecuteAsync( string message, CancellationToken ct) { Console.WriteLine($"Log: {message}"); return CompleteAsync(); } }


Register both Actions

var store = new InMemoryStore();

var wjb = WJbBuilder.Create(store, cfg => { cfg.AddAction<GreetAction>("greet"); cfg.AddAction<LogAction>("log"); }) .Build(store);


Run the workflow

await wjb.EnqueueAsync("greet", "Alice");
await wjb.ExecuteOnceAsync(); // runs GreetAction
await wjb.ExecuteOnceAsync(); // runs LogAction

What happens

GreetAction
    ↓
LogAction
    ↓
Complete

1. GreetAction prints the greeting. 2. It explicitly schedules LogAction. 3. LogAction writes the log message. 4. The workflow finishes.


Key idea

The next step is decided inside the Action using NextAsync.

Nothing is hidden.

An unhandled error has occurred. Reload πŸ—™

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.