# Evidently and Airflow

Apache Airflow is an open-source [workflow management tool](https://airflow.apache.org).

You can use this integration to generate JSON profiles or HTML reports and as a step in the Airflow DAG.

**An integration example is available as a Docker container:**

{% embed url="<https://github.com/evidentlyai/evidently/tree/main/examples/integrations/airflow_drift_detection>" %}

Follow the readme to install and modify the example.

It contains two specific DAGs that match common batch monitoring needs.

### 1. Generate model performance reports as a batch job

You can generate an Evidently report (e.g. a data drift report) every time the new data arrives. You can then store it in your file system.

**Here is a DAG example:**

{% embed url="<https://github.com/evidentlyai/evidently/blob/main/examples/integrations/airflow_drift_detection/dags/evidently_drift_dashboard.py>" %}

### 2. Generate visual performance reports on defined conditions

You might not always need to generate visual reports every time.

For example, you can run checks on the model performance and only generate the reports if a certain condition is satisfied. For example, if you detect drift or performance drop. Otherwise, you can simply log the results.

**Here is a DAG example:**

{% embed url="<https://github.com/evidentlyai/evidently/blob/main/examples/integrations/airflow_drift_detection/dags/evidently_conditional_drift_dashboard_generation.py>" %}

It works as the following:

* Run a data drift check by generating an Evidently JSON profile
* If the drift is not detected, log the JSON output
* If the drift is detected, generate and store a visual HTML report


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.evidentlyai.com/v0.1.57/integrations/evidently-and-airflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
