Customizing state colours in UI

New in version 1.10.11.

To change the colors for TaskInstance/DagRun State in the Airflow Webserver, perform the following steps:

  1. Create airflow_local_settings.py file and put in on $PYTHONPATH or to $AIRFLOW_HOME/config folder. (Airflow adds $AIRFLOW_HOME/config on PYTHONPATH when Airflow is initialized)

  2. Add the following contents to airflow_local_settings.py file. Change the colors to whatever you would like.

    STATE_COLORS = {
      "queued": 'darkgray',
      "running": '#01FF70',
      "success": '#2ECC40',
      "failed": 'firebrick',
      "up_for_retry": 'yellow',
      "up_for_reschedule": 'turquoise',
      "upstream_failed": 'orange',
      "skipped": 'darkorchid',
      "scheduled": 'tan',
    }
    
  3. Restart Airflow Webserver.

Screenshots

Before

../_images/dags-page-old.png ../_images/graph-view-old.png ../_images/tree-view-old.png

After

../_images/dags-page-new.png ../_images/graph-view-new.png ../_images/tree-view-new.png

Note

See Modules Management for details on how Python and Airflow manage modules.

Was this entry helpful?