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
π Observing Execution
WJb makes every job observable.
You can inspect the full lifecycle of a job at any moment.
What You Can Observe
For every job you can see:
- Current status (Pending, Running, Completed, Failed)
- Original payload
- Result (when completed)
- Error details (when failed)
- Progress percentage and message
- Timestamps (created, started, completed)
- Action name
Reading a Job
var job = await store.GetJobAsync(jobId);
Console.WriteLine($"Action : {job.Action}");
Console.WriteLine($"Status : {job.Status}");
Console.WriteLine($"Progress: {job.Progress}%");
Console.WriteLine($"Message : {job.Message}");
Querying Jobs
var jobs = await store.GetJobsAsync(new JobQuery
{
// filter by status, date, action name, etc.
});
Useful for building dashboards or administrative tools.
Real-time Monitoring
The recommended way to observe execution in real applications is the official UI:
WJb.UI.Blazor
It provides:
- Live list of jobs
- Status filtering
- Progress visualization
- Payload and result viewer
- Error inspection
- Retry and cancel buttons
Typical Observation Flow
1. Enqueue a job β receive jobId
2. Poll GetJobAsync(jobId) or use the UI
3. Watch status change:
Pending β Running β Completed / Failed
4. Read the final result or error
Example Polling Loop
while (true)
{
var job = await store.GetJobAsync(jobId);
Console.WriteLine($"{job.Status} - {job.Progress}%");
if (job.Status is JobStatus.Completed or JobStatus.Failed)
break;
await Task.Delay(1000);
}
if (job.Status == JobStatus.Completed)
Console.WriteLine("Result: " + job.Result);
else
Console.WriteLine("Error: " + job.Error);
Key Point
Because every transition is stored explicitly, you never have to guess what a job is doing.
Observation is a first-class feature of WJb, not an afterthought.