An Operator is conceptually a template for a predefined Task, defined declaratively inside a Dag and chained with the >> notation. Core operators include BashOperator, which executes a bash command, and PythonOperator, which calls an arbitrary Python function — the @task decorator is the TaskFlow equivalent; community providers add operators such as EmailOperator, HttpOperator, and SQLExecuteQueryOperator. Parameters registered in template_fields undergo Jinja substitution just before pre_execute; wrap a string in literal() to exclude it. Never name a third-party operator field params, which is reserved for Dag serialization. Inside f-strings, double the Jinja braces ({{{{ ds }}}}) so templates survive interpolation. pre_execute and post_execute run around each task instance, unlike setup and teardown tasks spanning multiple task instances. Scope: Apache Airflow. Reviewed October 4, 2026.
Operators and sensors
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- airflow.apache.org
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.