Client

class Client

Client for Airflow API calls scoped to the current task instance.

An instance is provided when a task is being executed. All reads and writes are automatically scoped to the current Dag run and task instance unless you pass explicit IDs.

Functions

Link copied to clipboard

Retrieves a connection from the Airflow connection store.

Link copied to clipboard
fun getVariable(key: String): Any?

Retrieves an Airflow variable.

Link copied to clipboard
fun getXCom(key: String = XCOM_RETURN_KEY, dagId: String = details.ti.dagId, taskId: String, runId: String = details.ti.runId, mapIndex: Int? = null, includePriorDates: Boolean = false): Any?

Reads an XCom value pushed by another task.

Link copied to clipboard
fun setXCom(key: String = XCOM_RETURN_KEY, value: Any)

Pushes an XCom value for downstream tasks to read.