Skip to main content
function TaskContext.defer
def TaskContext.defer(
callable: typing.Any,
/,
*args: typing.Any,
**kwargs: typing.Any
) -> None
Register a callable to run after _impl returns, modeled on Go’s defer: args bound at the defer site, LIFO order, fires even when _impl aborts. Per-defer errors are logged and do not change the task’s exit code. function TaskContext.http
def TaskContext.http() -> Http
HTTP client for issuing requests to remote services. property TaskContext.args
TaskContext.args: Arguments
Resolved arguments for this task invocation. Read individual values as ctx.args.<arg_name>. Values are produced by merging, in order of decreasing precedence: explicit CLI flags, config.axl overrides, and the task’s declared arg defaults. property TaskContext.aspect
TaskContext.aspect: aspect.Aspect
Aspect platform integrations — authentication and other hosted services provided by the Aspect Workflows backend. property TaskContext.bazel
TaskContext.bazel: bazel.Bazel
Drive Bazel from a task: run build, test, query, info, parse .bazelrc, and consume Build Event Stream output. property TaskContext.std
TaskContext.std: std.Std
The standard library. Gives access to common utilities such as filesystem, process execution, environment variables, and IO streams. property TaskContext.task
TaskContext.task: TaskInfo
Identity of the currently running task — its name, group(s), short human-readable key, and globally unique id. property TaskContext.template
TaskContext.template: Template
Render template files by substituting placeholders with values. property TaskContext.traits
TaskContext.traits: TraitMap
Configured trait instances visible to this task. Index by a trait type to read its fields, e.g. ctx.traits[GitHub].token. Only trait types this task opted into via task(traits = [...]) are present. property TaskContext.wasm
TaskContext.wasm: wasm.Wasm
Execute WebAssembly modules within a task. EXPERIMENTAL: this surface may change or be removed without notice.