How to retry a Job scheduler if it fails?

How to retry a Job scheduler?If suppose we call a queue processor in the Job schedulers activity but still how will it retry on its own?Like my Job scheduler will not run on its own at say 9pm cause of failure so how will the retry happen via queue processor?

Jobscheduler will not retry on its own when during execution if some exception occurs. Have your base logic in which we will not get any exceptions in job scheduler and take all the complex logic to queue processor, so that job scheduler will be responsible only for scheduling the needed items and remaining will be taken care via queue processor. In queue processor exception retry will be handled internally, we don’t want to build any custom logic.

A Job Scheduler does not retry itself automatically the way a Queue Processor retries.

If the Job Scheduler is supposed to run at 9 PM and that run fails, the scheduler itself simply waits for the next scheduled time unless you add your own retry design.

  • Job Scheduler → time-based trigger
  • Queue Processor → queued work item with built-in retry behavior based on max attempts.

So if your Job Scheduler activity calls a Queue Processor, the retry applies only to the queued item, not to the Job Scheduler trigger itself

If a Job Scheduler fails to start at 9pm (e.g., due to node unavailability), Pega can attempt to restart it upon node recovery if the MissedRunsOnStartup dynamic system setting is enabled.

Please find the below documentation.

@TanyaS58 Job schedulers work in way that if a run fails then only that execution instance will stop and next execution will work as per schedule. But like others said above. try to avoid putting any exception generated code into Job Scheduler and put the same in Queue processor instead. This way even if exception occurs, queue processor will first retry and if all retry fails then item will be sent to broken process queue which you can retry manually from Admin Studio. Hope this helps.

Hi @Gunasekaran_Baskaran but here I have a question see suppose every time at 9pm the Job scheduler has to run but in this case it didn’t execute due to some issue so how will the Queue processor be called?

Hi @RaviChandra yes I understood your point as Job scheduler itself will fail so how my queue processor will be called but how can i fix this?like how can we retry a Job scheduler?is there any way?

Hello @RameshSangili thanks for providing the documentation,however when i checked this DSS jobScheduler/periodic/retry/MissedRunsOnStartup/enabled in my personal edition,it was not available.Is this not an OOTB DSS?

You have to design it explicitly. Common options are:

  • Make the Job Scheduler lightweight and only identify/queue records; let the Queue Processor do the real work and retries
  • If the Job Scheduler run itself fails, rely on the next schedule or add a separate recovery mechanism, such as another scheduler/checker job
  • Build an idempotent catch-up process so the next successful run can pick up anything missed from the failed 9 PM run.

The best design is usually:

  • Job Scheduler runs at 9 PM.
  • It finds all eligible records and queues them.
  • Queue Processor processes each item and handles retries.
  • If 9 PM scheduler fails completely, the next run should detect unprocessed records and queue them again

That way you do not depend on the Job Scheduler “retrying itself,” because that is not really what it does.