How to Read an Apache Airflow® Setting with airflow config get-value
Apache Airflow® reads each setting from several places: environment variables, airflow.cfg and its built-in defaults. airflow config get-value prints the one value it ends up using, which is the quickest way to check a setting before you start Airflow or while you debug it. This guide reads a few settings on Airflow 3.4.0, and shows a trap with names that don't exist.
Syntax
airflow config get-value <section> <option>
| Part | What it means |
|---|---|
airflow config get-value | Airflow's command that, in its own help's words, will "Print the value of the configuration" |
<section> | The section the setting belongs to, without brackets: core for [core] |
<option> | The setting's name in that section, such as load_examples |
Prerequisites
- Apache Airflow® installed, with
AIRFLOW_HOMEset to the folder whose settings you want to read.
Step 1: Read a Few Settings
airflow config get-value core load_examples
airflow config get-value api port
airflow config get-value core dags_folder
True
8080
/Users/you/source/airflow-config-demo/dags

Each command prints one value: the example Dags are on, the API server would use port 8080, and Dags are read from the dags folder in my AIRFLOW_HOME. Airflow builds that path from AIRFLOW_HOME, so you see where it actually looks. Every airflow command on Python 3.14 also prints two FileType is deprecated warnings first; I left them out.
Step 2: See an Environment Variable Win
AIRFLOW__CORE__LOAD_EXAMPLES=False airflow config get-value core load_examples
False

The file still says True, but the environment variable comes first in Airflow's order of precedence, and get-value prints the value Airflow would use. That's why it's a better check than reading airflow.cfg yourself.
Step 3: Watch Out for Names That Don't Exist
A typo in the option name doesn't stop the command:
airflow config get-value core no_such_option
echo "exit status: $?"
2026-12-01T05:14:14.599416Z [warning ] section/key [core/no_such_option] not found in config [airflow._shared.configuration.parser] loc=parser.py:1463
exit status: 0

Airflow logs a warning, prints no value, and exits with status 0, the code for success, so the exit status can't tell you the name was wrong. Check names carefully.
Step 4: Use the Value in a Script
Airflow prints its warnings to standard output, the same place as the value. Capture the output in a variable and you get the warnings too:
value=$(airflow config get-value core load_examples)
echo "$value"
2026-12-01T05:38:22.031520Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=/Users/you/source/airflow-config-demo/.venv/lib/python3.14/site-packages/airflow/cli/cli_config.py lineno=662
2026-12-01T05:38:22.032237Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=/Users/you/source/airflow-config-demo/.venv/lib/python3.14/site-packages/airflow/cli/cli_config.py lineno=889
True
The value is always the last line, so keep only that with tail -n 1:
value=$(airflow config get-value core load_examples | tail -n 1)
echo "load_examples=$value"
load_examples=True

With a wrong name, the last line is the not found in config warning instead, so a script should check that the value is one it expects.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
airflow config get-value core.load_examples | airflow config get-value command error: the following arguments are required: option | Section and option as two words: core load_examples |
Brackets around the section: [core] | zsh stops with no matches found: [core]; bash passes them on and Airflow warns section/key [[core]/load_examples] not found in config | Write core |
| Trusting the exit status in a script | A wrong name still exits with 0 | Check that the value is one you expect |
| Capturing the whole output in a script | The variable holds warning lines as well as the value | Pipe through tail -n 1 |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
section/key [...] not found in config | A typo in the section or option | Look the name up in the configuration reference |
A value you didn't put in airflow.cfg | An AIRFLOW__… environment variable is set | env | grep AIRFLOW__ |
A path in ~/airflow | AIRFLOW_HOME isn't set in this terminal | Export it first |
FAQ
Are section and option names case-sensitive?
No. airflow config get-value api PORT and airflow config get-value API port both printed 8080.
How do I list every setting?
airflow config list prints every section and its options.
Does get-value change anything?
No, it only reads. The first airflow command in a new AIRFLOW_HOME does create airflow.cfg there, though.
Conclusion
airflow config get-value printed True, 8080 and the Dags folder for three settings, and False once an environment variable overrode the file, because it shows the value Airflow really uses. A wrong option name only logs a warning and exits with 0, and warnings share standard output with the value, so in scripts take the last line with tail -n 1 and check it.
Additional Resources
- Configuration reference — every section and option.
- Setting configuration options — the order of precedence.
- Command line interface reference — every
airflowcommand.
Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
