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.

    1. STATE_COLORS = {
    2. "queued": 'darkgray',
    3. "running": '#01FF70',
    4. "success": '#2ECC40',
    5. "failed": 'firebrick',
    6. "up_for_retry": 'yellow',
    7. "up_for_reschedule": 'turquoise',
    8. "upstream_failed": 'orange',
    9. "skipped": 'darkorchid',
    10. "scheduled": 'tan',
    11. }
  3. Restart Airflow Webserver.

    1 Screenshots

    1.1 Before

    🌳Customizing state colours in UI - 图1 🌳Customizing state colours in UI - 图2 🌳Customizing state colours in UI - 图3

    1.2 After

    🌳Customizing state colours in UI - 图4 🌳Customizing state colours in UI - 图5 🌳Customizing state colours in UI - 图6

:::tips 🔖 Note:
See Modules Management for details on how Python and Airflow manage modules. :::