TriggerDagRun

class TriggerDagRun(val dagId: String)

A task that starts a run of another Dag, in place of a task class.

Pass one to DagDef.task and the Java runtime runs it as Airflow's TriggerDagRunOperator does, so the Dag needs no Python worker for it:

dag.task("trigger_downstream",
new TriggerDagRun("downstream_etl")
.config("wait_for_completion", true)
.config("conf", Map.of("rows", 2)));

In an annotated Dag, an @Airflow.Task method returns one instead; the method runs when the Dag is built, not when the task runs.

The task runs no Java code and takes no arguments. It pushes the triggered run's ID, and the link the "Triggered DAG" extra link reads. It renders no templates, so a value such as "{{ ds }}" reaches the new run unchanged. Like a Java task, it runs on the Dag's queue unless the task sets its own.

Parameters

dagId

trigger_dag_id: the Dag to trigger.

Throws

if dagId is empty.

Constructors

Link copied to clipboard
constructor(dagId: String)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun config(key: String, value: Any?): TriggerDagRun

Sets one TriggerDagRunOperator setting, named as Python names the parameter.