is an object that represents a background task.


  • Tasks are created by functions such as SessionSubmit, LocalSubmit and CloudSubmit.
  • TaskObject[spec][prop] gives the value of a property of a task.
  • Properties of all tasks include:
  • "EvaluationExpression"expression to evaluate when the task is executed
    "EvaluationResult"result of evaluating the task expression
    "EventData"the most recent values of all handler functions keys
    "HandlerFunctions"handlers specified by the HandlerFunctions option
    "HandlerFunctionsKeys"handler functions keys specified by HandlerFunctionsKeys
    "TaskEnvironment""Session", "Local", "Cloud" or "External"
    "TaskStatus"status of the task ("Running", "Waiting", etc.)
    "TaskType"type of task ("Immediate", "Scheduled", etc.)
    "TaskUUID"unique task identifier
  • The expression to evaluate is returned wrapped in HoldForm.
  • The most recent values of handler functions keys given by "EventData" are returned as an association. If a particular key has not yet been set, it is returned as Missing[].
  • Scheduled tasks have the following additional properties:
  • "Schedule"task schedule specification
    "RunInterval"interval between task runs
    "PreviousRunCount"number of times the task has already run
    "RemainingRunCount"number of times the task still has to run
    "TotalRunCount"total number of times the task is scheduled to run
    "NextScheduledTime"next time the task is scheduled to run
  • A list of all available properties of a task object obj can be obtained using obj["Properties"].
  • Possible task statuses include:
  • "Waiting"task is waiting to run
    "Running"task expression is currently being evaluated
    "Finished"task is finished and will not repeat
    "Suspended"task has been suspended
    "Removed"task has been removed
  • Possible task types include: "Immediate", "Asynchronous", "Scheduled" and "Continuous".
  • Normal[obj] gives a representation of a TaskObject as an association.


Basic Examples  (4)

Run a task in the current session:

Convert a TaskObject to Association:

Create a task:

Look up a task's UUID:

Look up available task properties:

Get an Association representing the task:

Run a task in a separate kernel:

Run a cloud-based task:

Introduced in 2017
Updated in 2019