TaskContext

interface TaskContext { dagId: string; mapIndex: number; runId: string; signal: AbortSignal; taskId: string; tryNumber: number; }

Source: task.ts:30

Runtime metadata for the current task invocation.


Properties

dagId: string

readonly
task.ts:32

Identifier of the Dag containing this task.

mapIndex: number

readonly
task.ts:40

-1 for non-mapped tasks, 0..N-1 for mapped instances.

runId: string

readonly
task.ts:36

Dag run identifier for the current task attempt.

signal: AbortSignal

readonly
task.ts:48

AbortSignal that fires when Airflow terminates the task subprocess with SIGTERM or SIGINT.

Pass this signal to fetch(), timers, or any other API that accepts an abort signal for cooperative cancellation and cleanup.

taskId: string

readonly
task.ts:34

Task ID for this handler invocation, including any TaskGroup prefix.

tryNumber: number

readonly
task.ts:38

Airflow try number for the current task attempt.