This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 3.3.3!

Scheduled Tasks (scheduledtasks)

The scheduledtasks endpoint provides information about the application’s scheduled tasks.

Retrieving the Scheduled Tasks

To retrieve the scheduled tasks, make a GET request to /actuator/scheduledtasks, as shown in the following curl-based example:

$ curl 'http://localhost:8080/actuator/scheduledtasks' -i -X GET

The resulting response is similar to the following:

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1222

{
  "cron" : [ {
    "runnable" : {
      "target" : "com.example.Processor.processOrders"
    },
    "expression" : "0 0 0/3 1/1 * ?",
    "nextExecution" : {
      "time" : "2024-09-06T14:59:59.999683695Z"
    }
  } ],
  "fixedDelay" : [ {
    "runnable" : {
      "target" : "com.example.Processor.purge"
    },
    "initialDelay" : 0,
    "interval" : 5000,
    "nextExecution" : {
      "time" : "2024-09-06T14:27:59.533581276Z"
    },
    "lastExecution" : {
      "time" : "2024-09-06T14:27:54.528173155Z",
      "status" : "SUCCESS"
    }
  } ],
  "fixedRate" : [ {
    "runnable" : {
      "target" : "com.example.Processor.retrieveIssues"
    },
    "initialDelay" : 10000,
    "interval" : 3000,
    "nextExecution" : {
      "time" : "2024-09-06T14:28:04.511857113Z"
    }
  } ],
  "custom" : [ {
    "runnable" : {
      "target" : "com.example.Processor$CustomTriggeredRunnable@7d4d65f5"
    },
    "trigger" : "com.example.Processor$CustomTrigger@38cf3ae1",
    "lastExecution" : {
      "exception" : {
        "message" : "Failed while running custom task",
        "type" : "java.lang.IllegalStateException"
      },
      "time" : "2024-09-06T14:27:58.326502357Z",
      "status" : "ERROR"
    }
  } ]
}

Response Structure

The response contains details of the application’s scheduled tasks. The following table describes the structure of the response:

Path Type Description

cron

Array

Cron tasks, if any.

cron.[].runnable.target

String

Target that will be executed.

cron.[].nextExecution.time

String

Time of the next scheduled execution.

cron.[].expression

String

Cron expression.

fixedDelay

Array

Fixed delay tasks, if any.

fixedDelay.[].runnable.target

String

Target that will be executed.

fixedDelay.[].initialDelay

Number

Delay, in milliseconds, before first execution.

fixedDelay.[].nextExecution.time

String

Time of the next scheduled execution.

fixedDelay.[].interval

Number

Interval, in milliseconds, between the end of the last execution and the start of the next.

fixedRate

Array

Fixed rate tasks, if any.

fixedRate.[].runnable.target

String

Target that will be executed.

fixedRate.[].interval

Number

Interval, in milliseconds, between the start of each execution.

fixedRate.[].initialDelay

Number

Delay, in milliseconds, before first execution.

fixedRate.[].nextExecution.time

String

Time of the next scheduled execution.

custom

Array

Tasks with custom triggers, if any.

custom.[].runnable.target

String

Target that will be executed.

custom.[].trigger

String

Trigger for the task.

*.[].lastExecution

Object

Last execution of this task, if any.

*.[].lastExecution.status

Varies

Status of the last execution (STARTED, SUCCESS, ERROR).

*.[].lastExecution.time

String

Time of the last execution.

*.[].lastExecution.exception.type

String

Exception type thrown by the task, if any.

*.[].lastExecution.exception.message

String

Message of the exception thrown by the task, if any.