Skip to content
Tracon

JobHandlerKeys

Namespace Tracon · Assembly Tracon.Abstractions.dll

The built-in job handler keys, plus validation for the keys a consumer registers.

public static class JobHandlerKeys

objectJobHandlerKeys

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A handler key is a job’s identity: it is both how the job is classified (JobRecord.HandlerKey, the handlerKey query filter, the tracon.job.handler_key metric tag) and how the background worker picks the IJobHandler that executes it. There is no second field; a key registered with AddJobHandler<T>(key) is dispatched by exact, ordinal match, so registration order never decides the winner.

Grouping is done with the namespace prefix: everything Tracon ships starts with tracon., and a consumer picks its own prefix (contoso.). JobRecord.Lane (capacity) and JobRecord.TargetName (the handler’s input) stay separate from the key.

Runs an agent as a batch over a set of inputs.

public const string AgentBatch = "tracon.agent-batch"

string

A single queued (durable) agent run.

public const string AgentRun = "tracon.agent-run"

string

Runs started with Prefer: respond-async run under this key. Unlike JobHandlerKeys.AgentBatch, it does not require an item set, and the run identifier is generated IN ADVANCE by the caller (the HTTP layer) — JobRecord.Id carries the same value as the run identifier.

A new run that resumes a queued run after an approval decision.

public const string ApprovalResume = "tracon.approval-resume"

string

separate from JobHandlerKeys.AgentRun: the old run row closed with RunStatus.AwaitingApproval never changes again (the same principle as RunStatus.AwaitingInput); this job opens a new runs row with a new run identifier. The payload carries the identifier of the PendingApproval record whose decision was made.

An evaluation (eval) run over a suite’s cases.

public const string Eval = "tracon.eval"

string

Scores a sampled production run.

public const string OnlineEval = "tracon.online-eval"

string

The payload is empty or for diagnostics; the identifier of the run to score is the job item itself (JobItemRecord.Input) — the same pattern as how the JobHandlerKeys.Eval job carries a case identifier.

The prefix reserved for the handlers Tracon itself ships.

public const string ReservedPrefix = "tracon."

string

Registering a consumer handler under this prefix throws at startup, so a built-in key can never be shadowed by accident.

A retention sweep. JobRecord.TargetName is either a specific RetentionTargets value or "*", which processes all enabled policies.

public const string Retention = "tracon.retention"

string

A new run, in the SAME session, that continues an interrupted run.

public const string RunContinuation = "tracon.run-continuation"

string

separate from JobHandlerKeys.AgentRun and JobHandlerKeys.ApprovalResume: triggered by orphaned-run reconciliation, not by a client request. The old run row stays RunStatus.Failed and never changes again; this job opens a new runs row whose ContinuedFromRunId points at it.

A single webhook delivery attempt. The payload carries the delivery record’s identifier; the body is read from the webhook_deliveries table.

public const string WebhookDelivery = "tracon.webhook-delivery"

string

Runs a workflow, or responds to a pending workflow.

public const string Workflow = "tracon.workflow"

string

Every key Tracon itself ships, in no particular order.

public static IReadOnlyList<string> BuiltIn { get; }

IReadOnlyList<string>

Checks whether key falls inside the JobHandlerKeys.ReservedPrefix namespace.

public static bool IsReserved(string? key)

key string?

The candidate key.

bool

true if the key is reserved for Tracon.

Checks whether key is a valid handler key: 1-128 characters, lowercase ASCII letters, digits, ., _, or -, starting with a letter or digit.

public static bool IsValidKey(string? key)

key string?

The candidate key.

bool

true if the key is valid.

Uppercase letters are rejected, not normalized — the same reasoning as JobLanes.IsValidName. Keys are compared ordinally everywhere (dispatch, queries, metric tags), so allowing case variants would let "Contoso.Report" and "contoso.report" silently become two different handlers, and a job queued under one of them would never find its handler.