github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/docs/howto/hooks/airflow.md (about) 1 --- 2 title: Airflow Hooks 3 parent: Actions and Hooks 4 grand_parent: How-To 5 description: Airflow Hooks Reference 6 redirect_from: 7 - /hooks/airflow.html 8 --- 9 10 # Airflow Hooks 11 12 {% include toc.html %} 13 14 Airflow Hook triggers a DAG run in an Airflow installation using [Airflow's REST API](https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/post_dag_run). 15 The hook run succeeds if the DAG was triggered, and fails otherwise. 16 17 ## Action file Airflow hook properties 18 19 _See the [Action configuration](./index.md#action-file) for overall configuration schema and details._ 20 21 | Property | Description | Data Type | Example | Required | Environment Variables Supported | 22 |---------------|-----------------------------------------------------------------|-------------------------------------------------------------------------------------------|-------------------------|----------|------------------| 23 | url | The URL of the Airflow instance | String | `http://localhost:8080` | yes | no | 24 | dag_id | The DAG to trigger | String | `example_dag` | yes | no | 25 | username | The name of the Airflow user performing the request | String | `admin` | yes | no | 26 | password | The password of the Airflow user performing the request | String | `admin` | yes | yes | 27 | dag_conf | DAG run configuration that will be passed as is | JSON | | no | no | 28 | wait_for_dag | Wait for DAG run to complete and reflect state (default: false) | Boolean | | no | no | 29 | timeout | Time to wait for the DAG run to complete (default: 1m) | String (golang's [Duration](https://golang.org/pkg/time/#Duration.String) representation) | | no | no | 30 31 Example: 32 ```yaml 33 ... 34 hooks: 35 - id: trigger_my_dag 36 type: airflow 37 description: Trigger an example_dag 38 properties: 39 url: "http://localhost:8000" 40 dag_id: "example_dag" 41 username: "admin" 42 password: "{% raw %}{{{% endraw %} ENV.AIRFLOW_SECRET {% raw %}}}{% endraw %}" 43 dag_conf: 44 some: "additional_conf" 45 ... 46 ``` 47 48 ## Hook Record in configuration field 49 50 lakeFS will add an entry to the Airflow request configuration property (`conf`) with the event that triggered the action. 51 52 The key of the record will be `lakeFS_event` and the value will match the one described [here](./webhooks.html#request-body-schema)