Skip to content
Tracon

JobSchedule

Namespace Tracon · Assembly Tracon.Abstractions.dll

The schedule record defining when and how a job runs.

public sealed record JobSchedule : IEquatable<JobSchedule>
Inheritance
object ← JobSchedule
Implements
IEquatable<JobSchedule>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

If Cron is left empty, the schedule is triggered only manually (POST .../trigger); no automatic next-run time is computed.

public JobSchedule()

The creation time (UTC).

public required DateTimeOffset CreatedAt { get; init; }

DateTimeOffset

The identifier of the user/service that created the schedule.

public string? CreatedBy { get; init; }

string?

The five-field cron expression (minute hour day-of-month month day-of-week). If null, the schedule is triggered only manually.

public string? Cron { get; init; }

string?

Whether the schedule is enabled. If disabled, it is not triggered automatically.

public bool Enabled { get; init; }

bool

The key of the IJobHandler the jobs this schedule produces are dispatched to. See JobHandlerKeys.

public required string HandlerKey { get; init; }

string

The schedule identifier.

public Guid Id { get; init; }

Guid

The lane the jobs this schedule produces run in. See JobLanes. Both a cron-dispatched run and a manual POST .../trigger inherit this value.

public string Lane { get; init; }

string

The last run time (UTC). null if it never ran.

public DateTimeOffset? LastRunAt { get; init; }

DateTimeOffset?

The schedule name, unique within the tenant.

public required string Name { get; init; }

string

The next automatic run time (UTC). null if there is no cron.

public DateTimeOffset? NextRunAt { get; init; }

DateTimeOffset?

The worker picks a due schedule by this value and computes every later one itself. A schedule written straight to IJobScheduleStore with a cron expression must therefore carry its first run time here: saved with null, it never runs. A time at or before now runs it on the worker’s next pass. The scheduling API sets it for you.

The input set or parameters. Interpreted by the job’s handler.

public JsonElement Payload { get; init; }

JsonElement

An unset payload is stored as the empty JSON array, never as JsonValueKind.Undefined or JSON null: an undefined value cannot be written as JSON, and SQL Server rejects a null literal in a JSON column. Every reader treats the empty array as “no payload”.

The agent or workflow name to run.

public required string TargetName { get; init; }

string

The tenant the schedule belongs to.

public required string TenantId { get; init; }

string

The time zone the Cron expression is interpreted in.

public string TimeZone { get; init; }

string

The last-updated time (UTC).

public required DateTimeOffset UpdatedAt { get; init; }

DateTimeOffset

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(JobSchedule? other)

other JobSchedule?

bool

public override int GetHashCode()

int

public override string ToString()

string

public static bool operator ==(JobSchedule? left, JobSchedule? right)

left JobSchedule?

right JobSchedule?

bool

public static bool operator !=(JobSchedule? left, JobSchedule? right)

left JobSchedule?

right JobSchedule?

bool