Skip to main content

How to Read an Apache Airflow® Setting with airflow config get-value

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

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​

Syntax
airflow config get-value <section> <option>
PartWhat it means
airflow config get-valueAirflow'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_HOME set to the folder whose settings you want to read.

Step 1: Read a Few Settings​

Terminal
airflow config get-value core load_examples
airflow config get-value api port
airflow config get-value core dags_folder
Output
True
8080
/Users/you/source/airflow-config-demo/dags

The terminal: three airflow config get-value commands printing True for core load_examples, 8080 for api port, and the dags folder inside the project for core dags_folder.

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​

Terminal
AIRFLOW__CORE__LOAD_EXAMPLES=False airflow config get-value core load_examples
Output
False

The terminal: with AIRFLOW__CORE__LOAD_EXAMPLES=False in front of the command, airflow config get-value core load_examples prints 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:

Terminal
airflow config get-value core no_such_option
echo "exit status: $?"
Output
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

The terminal: airflow config get-value core no_such_option prints only a warning, section/key core/no_such_option not found in config, and 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:

Terminal
value=$(airflow config get-value core load_examples)
echo "$value"
Output
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:

Terminal
value=$(airflow config get-value core load_examples | tail -n 1)
echo "load_examples=$value"
Output
load_examples=True

The terminal: capturing airflow config get-value in a variable includes two FileType warnings before True, and with tail -n 1 the variable holds only 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​

MistakeWhat happensDo this instead
airflow config get-value core.load_examplesairflow config get-value command error: the following arguments are required: optionSection 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 configWrite core
Trusting the exit status in a scriptA wrong name still exits with 0Check that the value is one you expect
Capturing the whole output in a scriptThe variable holds warning lines as well as the valuePipe through tail -n 1

Troubleshooting​

SymptomLikely causeFix
section/key [...] not found in configA typo in the section or optionLook the name up in the configuration reference
A value you didn't put in airflow.cfgAn AIRFLOW__… environment variable is setenv | grep AIRFLOW__
A path in ~/airflowAIRFLOW_HOME isn't set in this terminalExport 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​

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.