Quartz.NETQuartz.NET
Home
Features
Blog
Discussions
NuGet
GitHub
Home
Features
Blog
Discussions
NuGet
GitHub
  • Getting Started

    • Overview
    • Quartz 4 Quick Start
    • Tutorial
      • Using Quartz
      • Jobs And Triggers
      • More About Jobs & JobDetails
      • Job Data
      • More About Triggers
      • Querying Jobs and Triggers
      • Simple Triggers
      • Cron Triggers
      • RecurrenceTrigger
      • Time and TimeProvider
      • Trigger and Job Listeners
      • Scheduler Listeners
      • Job Execution Middleware
      • Job Stores
      • Configuration, Resource Usage and Building a Scheduler
      • Building a Scheduler Without a Host
      • Clustering
      • Execution Groups
      • Node Affinity (Preferred Node)
      • Testing
      • Compile-Time Checks
      • Declaring Jobs with Attributes
      • Delegate Jobs
    • Configuration Reference
    • JSON Configuration
    • Cron Expression Reference
    • Multi-Tenancy
    • Comparison
    • Frequently Asked Questions
    • Best Practices
    • Before You Go Live
    • Operating a Cluster
    • Log Events
    • Tenancy Patterns
    • Database Schema
    • Database Schema Changes
    • Migration Guide
    • Troubleshooting
    • API Documentation
  • How To's
    • One-Off Job
    • Rescheduling Jobs
    • Retrying Failed Jobs
    • Pausing with a Reason
    • Job Continuations
    • Overlap Policy
    • Progress and Execution Logs
    • Multiple Triggers
    • Job Template
    • Running Quartz under Aspire
    • Quartz.NET with Wolverine
    • Coming from Hangfire
    • Coming from TickerQ
    • Embedding Quartz in a Library
    • Running under an External Leader Election
    • Publishing Trimmed and Native AOT
    • Extending Quartz: what is open, what is closed, and how to ask
    • A Job Store of Your Own
    • A Driver Delegate for a New Database
    • Persisting a Custom Trigger Type
    • A Lock Handler of Your Own
  • Packages

    • Quartz Core Additions

      • Jobs
      • Serialization (System.Text.Json)
      • JSON Serialization
      • Plugins
    • Integrations

      • Aspire Integration
      • ASP.NET Core Integration
      • HTTP API
      • HTTP Client
      • Dashboard
      • Hosted Services Integration
      • Microsoft DI Integration
      • Multiple Schedulers with Microsoft DI
      • Observability
      • Redis Lock Handler
      • TimeZoneConverter Integration
    • 3rd Party Plugins for Quartz
  • Quartz 3.x

    • Getting Started

      • Quartz 3 Quick Start
      • Tutorial
        • Using Quartz
        • Library Overview
        • Jobs And Triggers
        • More About Jobs
        • More About Triggers
        • Execution Groups
        • Node Affinity (Preferred Node)
        • Simple Triggers
        • Cron Triggers
        • RecurrenceTrigger
        • Trigger and Job Listeners
        • Scheduler Listeners
        • Job Stores
        • Tuning the Scheduler
        • Configuration, Resource Usage and SchedulerFactory
        • Advanced (Enterprise) Features
      • Configuration Reference
      • JSON Configuration
      • Multi-Tenancy
      • Frequently Asked Questions
      • Best Practices
      • Tenancy Patterns
      • Troubleshooting
      • API Documentation
      • Database Schema
      • Database Schema Changes
      • Migration Guide
      • Miscellaneous Features
    • How To's

      • One-Off Job
      • Multiple Triggers
      • Job Template
      • Using the CronTrigger
      • Rescheduling Jobs
    • Packages

      • Quartz Core Additions

        • Dashboard
        • Jobs
        • Serialization (System.Text.Json)
        • Serialization (Newtonsoft Json.NET)
        • Plugins
      • Integrations

        • ASP.NET Core Integration
        • Hosted Services Integration
        • Microsoft DI Integration
        • Multiple Schedulers with Microsoft DI
        • OpenTelemetry Integration
        • OpenTracing Integration
        • Redis Lock Handler
        • TimeZoneConverter Integration
      • 3rd Party Plugins for Quartz
  • Old Releases

    • Quartz 2.x
      • Quartz 2 Quick Start
      • Tutorial
        • Lesson 1: Using Quartz
        • Lesson 2: Jobs And Triggers
        • Lesson 3: More About Jobs & JobDetails
        • Lesson 4: More About Triggers
        • Lesson 5: SimpleTrigger
        • Lesson 6: CronTrigger
        • Lesson 7: TriggerListeners and JobListeners
        • Lesson 8: SchedulerListeners
        • Lesson 9: JobStores
        • Lesson 10: Configuration, Resource Usage and SchedulerFactory
        • Lesson 11: Advanced (Enterprise) Features
        • Lesson 12: Miscellaneous Features of Quartz
        • CronTrigger Tutorial
      • Configuration Reference
      • Migration Guide
      • API Documentation
    • Quartz 1.x
      • Tutorial
        • Lesson 1: Using Quartz
        • Lesson 2: Jobs And Triggers
        • Lesson 3: More About Jobs & JobDetails
        • Lesson 4: More About Triggers
        • Lesson 5: SimpleTrigger
        • Lesson 6: CronTrigger
        • Lesson 7: TriggerListeners and JobListeners
        • Lesson 8: SchedulerListeners
        • Lesson 9: JobStores
        • Lesson 10: Configuration, Resource Usage and SchedulerFactory
        • Lesson 11: Advanced (Enterprise) Features
        • Lesson 12: Miscellaneous Features of Quartz
      • API Documentation
  • License

Pausing with a Reason

A pause can say why and who asked; the store adds when. Each pause member has a *With twin that takes a PauseDetails. From 4.3.

await scheduler.PauseTriggerWith(
    new TriggerKey("nightly-export"),
    new PauseDetails { Reason = "vendor API is down until 18:00", RequestedBy = "alice" });

The members

MemberPausesRecords the pause on
PauseTriggerWith(key, details)one triggerthe trigger
PauseJobWith(key, details)every trigger of the jobeach trigger it paused
PauseTriggerGroupsWith(matcher, details)the matching trigger groupseach group, and each trigger it paused
PauseJobGroupsWith(matcher, details)the matching job groupseach group, and each trigger it paused
PauseAllWith(details)every trigger groupeach group, and each trigger it paused
  • Each answers what its reasonless twin answers and raises the same listener events.
  • The key-set forms, PauseTriggers and PauseJobs, take no details.
  • An already paused trigger or group keeps the pause it had.
  • null, or details with both texts blank, is the reasonless pause. It records nothing and is made exactly as the reasonless member makes it.
  • A persistent store makes a reasonless pause through the IDriverDelegate members 4.2 used. A StdAdoDelegate subclass that overrides them keeps deciding how such a pause is written.
await scheduler.PauseJobGroupsWith(
    GroupMatcher<JobKey>.GroupEquals("billing"),
    new PauseDetails { Reason = "quarter close", RequestedBy = "finance-ops" });
PauseDetailsLongest keptBlank
Reason250 UTF-16 code units, PauseDetails.MaxReasonLength; longer is cutnull; both blank is the reasonless pause
RequestedBy200, PauseDetails.MaxRequestedByLength; longer is cutnull; both blank is the reasonless pause

PausedAtUtc is the scheduler's clock, its TimeProvider.

Reading it back

PauseInfo? pause = await scheduler.GetTriggerPause(new TriggerKey("nightly-export"));
if (pause is not null)
{
    // Either text may be null; a pause that said neither recorded nothing, so reads as null.
    Console.WriteLine($"Paused {pause.PausedAtUtc:u} by {pause.RequestedBy ?? "?"}: {pause.Reason}");
}
MemberAnswers
GetTriggerPause(key)the trigger's own record; for a trigger born paused into a paused group, the trigger group's, then the job group's
GetTriggerGroupPause(group)the trigger group's record
GetJobGroupPause(group)the job group's record
TriggerHeader.Pausethe trigger's own record, on every QueryTriggers row

Each is null when the trigger or group is not paused, does not exist, was paused without a reason, or was paused by a 4.2 node (see below). Resuming clears the record.

Pausing when retries run out

PauseTriggerWhenRetriesExhausted() pauses a trigger whose retry policy gives up, instead of letting it return to its schedule and fail again.

builder.Services.AddQuartz(q =>
{
    // A trigger whose retry policy gives up is paused, with the job's exception message as
    // the reason, until somebody resumes it.
    q.PauseTriggerWhenRetriesExhausted();

    q.AddJob<ExportJob>(j => j.WithIdentity("export"));
    q.AddTrigger(t => t
        .ForJob("export")
        .WithIdentity("nightly-export")
        .WithCronSchedule("0 0 2 * * ?")
        .WithRetryPolicy(RetryPolicy.Fixed(3, TimeSpan.FromMinutes(5))));
});
  • Reason is the message of the exception the job threw, cut to 250.
  • RequestedBy is quartz:retries-exhausted, so a listing tells it from an operator's pause.
  • Only a trigger with a policy is ever paused; one with no next occurrence is finished instead.
  • It is a trigger listener on TriggerRetriesExhausted. Calling it twice registers one.
  • Resume the trigger once the cause is fixed. The dashboard's Resume does it.

Over HTTP

The single-key, group and pause-all routes take an optional JSON body. The key-set …/keys/pause routes take none.

POST /quartz-api/schedulers/core/triggers/reports/nightly-export/pause
Content-Type: application/json

{ "reason": "vendor API is down until 18:00", "requestedBy": "alice" }
  • No body is the 4.2 pause: the reasonless member, nothing recorded, the caller not named.
  • With a body, requestedBy left out is the authenticated user's name, HttpContext.User.Identity.Name.
  • AddQuartzHttpClient sends no body for details that say nothing.
  • The state, group-paused and trigger-listing answers carry a pause object. Details: HTTP API.
  • AddQuartzHttpClient sends and reads the rest, so PauseTriggerWith on a remote scheduler records the reason on the server.

In the dashboard

  • Pause, Pause group, Pause all and Pause selected ask for an optional reason, once per click.
  • The requester is the signed-in user's name. An anonymous visitor who types no reason makes the reasonless pause.
  • A paused trigger shows Paused: reason (by who, when) on its page and in the listings; a paused job group shows its record on the Jobs page.
  • Read-only mode hides the prompts and keeps the notes.

A mixed cluster

A persistent store keeps the record in three columns, PAUSE_REASON, PAUSED_BY and PAUSED_AT, on QRTZ_TRIGGERS and both paused-group tables. 4.3/add_pause_reason adds them, and a 4.3 node refuses to start without them. A 4.2 node sharing the database neither writes nor clears them.

While the cluster runs bothWhat a 4.3 node reads
A 4.2 node pausesnull: no record
A 4.3 node pauses, a 4.2 node resumesnull: a record is read only while the trigger is paused or the group row exists
A 4.3 node pauses a trigger with a reason, a 4.2 node resumes it, then any node pauses it without onethe first pause's record, which is stale

A pause without a reason writes what 4.2 wrote, so it cannot clear what a 4.2 resume left. Roll every node to 4.3 before relying on the record.

See also

  • Retrying Failed Jobs — the retry policy, and what happens when it gives up
  • Dashboard — pause, resume and the trigger pages
  • HTTP API — the pause body and the pause field
Help us by improving this page!
Last Updated: 9/27/26, 6:01 PM
Contributors: Marko Lahma, Claude Opus 5.5
Prev
Retrying Failed Jobs
Next
Job Continuations