Table of Contents

Class JobRecord

Namespace
Millrace.Storage
Assembly
Millrace.dll

A job as persisted by a storage provider. Immutable — providers store snapshots and the engine derives new states via JobTransition, never by mutation.

public sealed record JobRecord : IEquatable<JobRecord>
Inheritance
JobRecord
Implements
Inherited Members

Remarks

Attempt vs Failures. Attempt counts executions started — every claim increments it, including lease-expiry reclaims — and exists for transition fencing and poison detection. Failures counts recorded failures — only Failed/Dead transitions increment it — and drives retry math. An interruption (crash, deploy, lease loss) therefore never consumes retry budget.

Idempotency. Key uniqueness is scoped to (TenantId, IdempotencyKey) among active (non-terminal) jobs; a null tenant forms its own single scope; uniqueness is global across queues within a scope. Release on terminal transition is a uniqueness-scope rule, not a field mutation — the record keeps its key.

Properties

ActivityNodeId

The workflow node this job executes, if any.

Attempt

Executions started (incremented by every claim). Fencing/poison detection only.

CancelRequested

Set by TryCancelAsync on a Processing job. Cooperative: the worker observes it via lease renewal and cancels; a completing worker may still win with a fenced terminal transition.

CreatedAt

When this record was enqueued.

DueAt

Activation time while Scheduled or Failed.

Failures

Recorded failures. Retry math consumes this, never Attempt.

FinishedAt

When the job's execution ended, as stamped by the transition that ended it.

Id

Engine-generated identity, stable for the life of the record.

IdempotencyKey

The deduplication key, if the enqueue supplied one.

Invocation

What to run.

LastError

Message from the most recent failure.

LeaseUntil

When the current claim lapses, after which the job may be reclaimed.

ParentId

Parent job for continuations (state Awaiting).

Priority

Higher priority is claimed first; FIFO by enqueue order within equal priority.

Queue

The queue this job is claimed from.

RecurringId

The recurring definition that produced this job, if any (§11.26).

RequeuedFrom

The job this one was requeued from, if any (§11.19).

Retry

The retry policy this job runs under.

State

Where the job is in its lifecycle.

TenantId

The owning tenant, or null.

TraceParent

W3C traceparent captured where the job was enqueued, so its execution continues that trace rather than starting a new one (§8).

WorkerId

The worker currently holding the claim; null when nothing holds it.

WorkflowInstanceId

Correlation to the owning workflow instance, if any (workflow engine, 0.3).