function TaskContext.defer
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, after the post-task hooks. A failing defer is reported as a WARNING: and does not change the task’s exit code. Use ctx.hooks.post_task instead when the callback needs to know how the task ended.
function TaskContext.http
HTTP client for issuing requests to remote services.
property TaskContext.args
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
Aspect platform integrations — authentication and other hosted services provided by the Aspect Workflows backend.
property TaskContext.bazel
Drive Bazel from a task: run
build, test, query, info, parse .bazelrc, and consume Build Event Stream output.
property TaskContext.hooks
Hooks around the task body. From inside the body only
ctx.hooks.post_task(fn) is useful: fn(ctx, conclusion) runs after _impl ends, however it ended, before ctx.defer callbacks.
property TaskContext.std
The standard library. Gives access to common utilities such as filesystem, process execution, environment variables, and IO streams.
property TaskContext.task
Identity of the currently running task — its name, group(s), short human-readable key, and globally unique id.
property TaskContext.template
Render template files by substituting placeholders with values.
property TaskContext.traits
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
Execute WebAssembly modules within a task.
EXPERIMENTAL: this surface may change or be removed without notice.

