WJb Docs - Reference
Browse APIs, configuration options, interfaces, and implementation details.
⚡ Actions
🔀 Workflow
📦 Jobs
⚙️ Runtime
💾 Persistence
🗄 Storage
🧩 Workflow Metadata
🛠 Extensions & Helpers
Results
Provides factory methods for creating IActionResult instances.
Results is the primary entry point for constructing workflow outcomes in WJb.
Instead of creating result implementations directly, actions typically use the Results helper.
Purpose
Results simplifies result creation and improves readability.
Compare:
return new CompleteResult();
with:
return Results.Complete();
The second form is shorter, clearer, and easier to discover.
Common Usage
Most actions return a result through Results.
public sealed class SendEmailAction : JobAction<SendEmailRequest>
{
public override Task<IActionResult> ExecuteAsync(
SendEmailRequest request,
CancellationToken cancellationToken)
{
return Task.FromResult(Results.Complete());
}
}
Workflow Role
Action
↓
Results
↓
IActionResult
↓
JobCommand
Results does not execute work.
It creates result objects that describe the desired workflow outcome.
Common Outcomes
Typical result categories include:
- Complete the current workflow
- Continue with another job
- Create follow-up work
- Produce workflow transitions
Readability
Results makes workflow intent visible.
return Results.Complete();
can be understood immediately without examining implementation details.
Best Practices
Prefer Results Over Direct Construction
Use the helper whenever possible.
This keeps action code consistent across the application.
Return Explicit Workflow Intent
Choose a result that clearly communicates the next workflow step.
Keep Actions Focused
Actions perform business logic.
Results express workflow behavior.
Relationship to IActionResult
Results creates implementations of IActionResult.
Results
↓
IActionResult
The returned result is later translated into one or more JobCommand instances.
Related Types
- IActionResult
- CompleteResult
- NextResult
- JobCommand
- JobCommands
- IAction
See Also
- IActionResult
- CompleteResult
- NextResult
- JobCommand