Skip to main content

Task properties

The following task properties are defined in the process body:

task.attempt

The current task attempt.

task.exitStatus

Available only in script: and shell: blocks

The exit code returned by the task script.

The exit code is only available after the task has been executed (e.g., the errorStrategy directive).

task.hash

Available only in exec: blocks

The task hash.

task.index

The process-level task index.

task.name

Available only in exec: blocks

The task name.

task.previousException
Added in version 24.10

The exception reported by the previous task attempt.

Since the exception is available after a failed task attempt, it can only be accessed when retrying a failed task execution, i.e., when task.attempt is greater than 1.

task.previousTrace
Added in version 24.10

The trace record associated with the previous task attempt.

Since the trace record is available after a failed task attempt, it can only be accessed when retrying a failed task execution, i.e., when task.attempt is greater than 1. See Trace file for a list of available fields.

note

The trace fields %cpu and %mem can be accessed as pcpu and pmem, respectively.

task.process

The name of the process that spawned the task.

task.workDir

Available only in exec: blocks

The unique directory path for the task.

note

Directive values for a task can be accessed via task.<directive>. See Task directive values for more information.

On this Page