WJb Docs - Intermediate

Learn workflows, persistence, scheduling, and production-ready patterns.

πŸš€ Start Here
🧩 Mental Model
🌊 Building Workflows
πŸ’₯ Failures & Control
πŸ‘€ Observation & Debugging
πŸ›  Practical Patterns
βœ… Working Examples
➑️ What’s Next

πŸ” Explicit vs Hidden

WJb is designed around one clear distinction:

Explicit transitions versus Hidden transitions.


Hidden Approach (Typical Systems)

In many background job frameworks the flow looks like this:

Job
 ↓
Pipeline
 ↓
Middleware
 ↓
Filters
 ↓
Retry Policy
 ↓
Continuation (configured somewhere)

Problems:

  • Workflow logic is scattered
  • Next steps are often defined outside the code
  • Debugging requires understanding framework internals
  • It is hard to answer β€œwhat runs next?” by reading one place

Explicit Approach (WJb)

WJb keeps everything visible:

Action
 ↓
IActionResult
 ↓
JobCommand
 ↓
Next Job

The action itself decides the next step:

return await NextAsync<LogAction>(
    new LogInput { Message = "Email sent" });

Or finishes the workflow:

return await CompleteAsync();

No hidden pipelines. No external workflow definition. No magic.


Side-by-Side Comparison

| Aspect | Hidden Systems | WJb (Explicit) | |---------------------|-----------------------------|---------------------------------| | Next step | Config / Middleware | Returned from the action | | Workflow definition | Often external | Pure C# code | | Debugging | Framework knowledge needed | Read the action | | Testing | Harder | Straightforward | | Visibility | Low | High |


Concrete Example

Hidden style (conceptual)

// Somewhere in configuration or attributes
[ContinueWith("LogAction")]
public class SendEmailAction { ... }

Explicit style (WJb)

public override async Task<IActionResult> ExecuteAsync(
    EmailInput input, CancellationToken ct)
{
    // send email...

return await NextAsync<LogAction>( new LogInput { Message = "Email sent" }); }

The decision lives in the same method that performs the work.


Why Explicit Wins

  • You always know where the workflow logic is
  • Changes are localized
  • Code reviews catch workflow mistakes early
  • New team members understand the flow quickly
  • No surprises at runtime

The Rule

If the next step is not visible when you read the action, the workflow is not explicit enough.

WJb forces the workflow to stay visible.

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.