Introduction to Apache Airflow in Python
Mike Metzger
Data Engineer

from airflow.providers.standard.operators.hitl import ApprovalOperatorsubject - The subject / title of the approvalbody - Content of the messageexecution_timeout - timedelta of how long to wait for responsedefaults - Whether to default to approve or reject if timeoutassigned_users - List of users to post message toapprove_gate = ApprovalOperator(
task_id="approve_data_import",
subject="Data import - Approval Required",
body=(
"Please review the data produced by the *extract_info* task."
"Approve to write data to the database, or Reject to halt the run."
),
)
On the Dag run view, a RequiredActions view shows up if a task requiring Approval is waiting.



Introduction to Apache Airflow in Python