Writing tasks
Context
Get the context of a task run.
Context (ctx
) is a way to get information about a run.
The context object does not change whilst your code is executing. This means values like ctx.run.durationMs
will be fixed at the moment the run()
function is called.
Context properties
task
object
exportName
string
The exported function name of the task e.g. myTask
if you defined it like this: export const myTask = task(...)
.
id
string
The ID of the task.
filePath
string
The file path of the task.
attempt
object
run
object
queue
object
environment
object
organization
object
project
object
batch
object
Optional information about the batch, if applicable.
machine
object
Optional information about the machine preset used for execution.
Was this page helpful?