Skip to content

Apache Airflow

Connect HolmesGPT to the Airflow Stable REST API.

Prerequisites

  • A reachable Airflow API server
  • Read access to DAGs, DAG runs, task instances, and task logs

Configuration

Airflow 3 uses API v2:

Add the following to ~/.holmes/config.yaml. Create the file if it doesn't exist:

toolsets:
  airflow:
    enabled: true
    config:
      api_url: https://airflow.example.com
      api_version: v2
      bearer_token: "{{ env.AIRFLOW_TOKEN }}"
      max_items: 100
      max_log_characters: 20000

When using the standalone Holmes Helm Chart, update your values.yaml:

toolsets:
  airflow:
    enabled: true
    config:
      api_url: https://airflow.example.com
      api_version: v2
      bearer_token: "{{ env.AIRFLOW_TOKEN }}"
      max_items: 100
      max_log_characters: 20000

Apply the configuration:

helm upgrade holmes holmes/holmes --values=values.yaml

When using the Robusta Helm Chart (which includes HolmesGPT), update your generated_values.yaml:

holmes:
  toolsets:
    airflow:
      enabled: true
      config:
        api_url: https://airflow.example.com
        api_version: v2
        bearer_token: "{{ env.AIRFLOW_TOKEN }}"
        max_items: 100
        max_log_characters: 20000

Apply the configuration:

helm upgrade robusta robusta/robusta --values=generated_values.yaml --set clusterName=<YOUR_CLUSTER_NAME>

For Airflow 2, set api_version: v1. Basic authentication is available through username and password.

Multiple Instances

The Apache Airflow toolset can connect to more than one Apache Airflow instance. List each one under instances: with a unique name. Any config field set outside instances: becomes a default that every instance inherits, so shared settings only need to be written once.

toolsets:
  airflow:
    enabled: true
    config:
      instances:
        - name: prod
          api_url: https://airflow.example.com
          api_version: v2
          bearer_token: "{{ env.AIRFLOW_TOKEN }}"
        - name: staging
          api_url: https://airflow.example.com
          api_version: v2
          bearer_token: "{{ env.AIRFLOW_TOKEN }}"

When more than one instance is configured, HolmesGPT automatically adds an instance parameter to every Apache Airflow tool (so it can pick which instance to query) and a airflow_list_instances tool to list the configured instances. With a single instance — including the flat config without instances: — the tools are unchanged and fully backwards compatible.

See Multiple Instances for the full behaviour, including global defaults and health reporting.

Common Use Cases

Find the failed tasks in the latest orders DAG run
Read the failed task attempt log and identify the root cause