Task

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Task(val id: String = "", val owner: String = "airflow", val startDate: String = "", val endDate: String = "", val triggerRule: String = "all_success", val dependsOnPast: Boolean = false, val ignoreFirstDependsOnPast: Boolean = false, val waitForPastDependsBeforeSkipping: Boolean = false, val waitForDownstream: Boolean = false, val retries: Int = 0, val queue: String = "default", val pool: String = "default_pool", val poolSlots: Int = 1, val executionTimeout: String = "", val retryDelay: String = "PT5M", val retryExponentialBackoff: Double = 0.0, val maxRetryDelay: String = "", val priorityWeight: Int = 1, val weightRule: String = "downstream", val executor: String = "", val doXcomPush: Boolean = true, val emailOnFailure: Boolean = true, val emailOnRetry: Boolean = true, val docMd: String = "", val mapIndexTemplate: String = "", val maxActiveTisPerDag: Int = -1, val maxActiveTisPerDagrun: Int = -1)

Annotation to automate task definition in a Dag-builder pattern.

Configuration attributes are Airflow's own task settings; only attributes written explicitly at the use site are applied.

Properties

Link copied to clipboard
val dependsOnPast: Boolean = false

Airflow's depends_on_past setting.

Link copied to clipboard

Airflow's doc_md setting.

Link copied to clipboard
val doXcomPush: Boolean = true

Airflow's do_xcom_push setting.

Link copied to clipboard

Airflow's email_on_failure setting.

Link copied to clipboard
val emailOnRetry: Boolean = true

Airflow's email_on_retry setting.

Link copied to clipboard

Airflow's end_date setting; an ISO-8601 date-time such as "2026-01-01T00:00:00Z".

Link copied to clipboard

Airflow's execution_timeout setting; an ISO-8601 duration such as "PT5M".

Link copied to clipboard

Airflow's executor setting.

Link copied to clipboard
val id: String

Task ID. Empty derives it from the annotated function's name.

Link copied to clipboard

Airflow's ignore_first_depends_on_past setting.

Link copied to clipboard

Airflow's map_index_template setting.

Link copied to clipboard

Airflow's max_active_tis_per_dag setting.

Link copied to clipboard

Airflow's max_active_tis_per_dagrun setting.

Link copied to clipboard

Airflow's max_retry_delay setting; an ISO-8601 duration such as "PT5M".

Link copied to clipboard

Airflow's owner setting.

Link copied to clipboard

Airflow's pool setting.

Link copied to clipboard
val poolSlots: Int = 1

Airflow's pool_slots setting.

Link copied to clipboard

Airflow's priority_weight setting.

Link copied to clipboard

Airflow's queue setting.

Link copied to clipboard
val retries: Int = 0

Airflow's retries setting.

Link copied to clipboard

Airflow's retry_delay setting; an ISO-8601 duration such as "PT5M".

Link copied to clipboard

Airflow's retry_exponential_backoff setting.

Link copied to clipboard

Airflow's start_date setting; an ISO-8601 date-time such as "2026-01-01T00:00:00Z".

Link copied to clipboard

Airflow's trigger_rule setting.

Link copied to clipboard

Airflow's wait_for_downstream setting.

Link copied to clipboard

Airflow's wait_for_past_depends_before_skipping setting.

Link copied to clipboard

Airflow's weight_rule setting.