TaskHandler

Source: task-handler.ts:65

A TypeScript function bound to the Python-owned task it implements.

A mixed-language Dag declares its structure in Python, with a @task.stub per task routed to the Node coordinator. TypeScript supplies the task bodies and nothing else: no dag_id of its own, no schedule, no task order.

CODE
const bundle = new Bundle();
bundle.register(new TaskHandler("etl", "transform", transform));
await bundle.serve();

dagId must match the Python Dag's dag_id and taskId a @task.stub in it, including any TaskGroup prefix. Both are written out: nothing is derived from the handler's function name, which the build step is free to rename.

Identity and a body, and no more. A handler has no factory to call, so wiring one the way a natively declared task is wired is a compile error rather than a runtime throw. For a native Dag, use Dag instead.

Type Parameters

  • TArgs = void
  • TReturn = unknown

Constructors

new TaskHandler< TArgs = void, TReturn = unknown, >( dagId: string, taskId: string, handler: TaskFunction<TArgs, TReturn>, ): TaskHandler<TArgs, TReturn>

Parameters

  • dagId (string)
  • taskId (string)
  • handler (TaskFunction<TArgs, TReturn>)

Returns

TaskHandler<TArgs, TReturn>


Properties

dagId: string

Identifier of the Python Dag this task belongs to.

taskId: string

Airflow task ID this handler implements, including any TaskGroup prefix.