
Airflow Hitl
- 801 installs
- 412 repo stars
- Updated July 27, 2026
- astronomer/agents
airflow-hitl is an agent skill that adds deferrable human-in-the-loop operators to Airflow DAGs for developers who need approvals and form input without holding worker slots.
About
airflow-hitl is an Astronomer agents skill for human-in-the-loop workflows in Apache Airflow 3.1+. It covers ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, and HITLTrigger so DAGs pause until a human responds via the Airflow UI or REST API. HITL operators are deferrable—they release worker slots while waiting for approval, rejection, form input, or human-driven branching. Humans respond from Browse → Required Actions or the task instance Required Actions tab. The skill does not cover AI or LLM calls (see airflow-ai). Use airflow-hitl when pipeline steps need human gates without blocking workers.
- Pause DAGs with deferrable HITL operators that free worker resources while waiting
- 5 distinct operator types: ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, HITLTrigger
- Human responses collected via Airflow UI Required Actions tab or REST API
- Requires Airflow 3.1+ and uses dynamic signature discovery instead of hardcoded parameters
- Hard-gate: always fetch current operator signature before writing code
Airflow Hitl by the numbers
- 801 all-time installs (skills.sh)
- +17 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #332 of 2,742 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/astronomer/agents --skill airflow-hitlAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 801 |
|---|---|
| repo stars | ★ 412 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | astronomer/agents ↗ |
How do you add human approval steps in Airflow?
Add human approval, form input, and branching decisions into Airflow DAGs without holding worker slots.
Who is it for?
Data engineers on Airflow 3.1+ building DAGs that need human approval, forms, or branching without occupying workers.
Skip if: Airflow versions below 3.1 or pipelines that only need LLM calls without human gates.
When should I use this skill?
A DAG needs human approval, form input, or human-driven branching with deferrable operators in Airflow 3.1+.
What you get
Airflow DAG tasks with deferrable HITL operators, Required Actions UI flow, and REST API response wiring.
- HITL-enabled DAG tasks
- Required Actions workflow
By the numbers
- Requires Airflow 3.1+
- Covers 5 HITL operators: ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, HITLTrigger
Files
Airflow Human-in-the-Loop Operators
Pause a DAG until a human responds via the Airflow UI or REST API. HITL operators are deferrable — they release their worker slot while waiting.
Requires Airflow 3.1+ (af config version).>
UI location: Browse → Required Actions. Respond from the task instance page's Required Actions tab.
>
Cross-references:airflow-aifor AI/LLM task decorators;airflowfor registry and API discovery commands used below.
---
Step 1 — Pick the capability you need
| Capability | Class (verify in Step 2) |
|---|---|
| Approve or reject; downstream skips on reject | ApprovalOperator |
| Present N options and return which were chosen | HITLOperator |
| Branch to one or more downstream tasks based on a choice | HITLBranchOperator |
| Collect a form (no approve/select step) | HITLEntryOperator |
| Use the HITL trigger directly (advanced / custom operators) | HITLTrigger |
This is the only place class names are hardcoded. The provider adds, renames, and removes params across releases — do not copy parameter lists from memory. Fetch the current signature before writing code.
---
Step 2 — Discover the current signatures from the Airflow Registry
Before writing HITL code, run these to see the live roster and constructor params (see the airflow skill for the full af registry reference):
# Every HITL-related module in the standard provider
af registry modules standard \
| jq '.modules[] | select(.import_path | test("\\.hitl\\.")) | {name, type, import_path, short_description, docs_url}'
# Constructor signatures: name, type, default, required, description
af registry parameters standard \
| jq '.classes | to_entries[] | select(.key | test("\\.hitl\\.")) | {fqn: .key, parameters: .value.parameters}'
# Pin to the exact installed provider version
af config providers \
| jq '.providers[] | select(.package_name == "apache-airflow-providers-standard") | .version'
# then: af registry parameters standard --version <VERSION>If the registry shows a param that this skill does not mention, prefer the registry. If the registry shows a class that is not in Step 1, treat it as additive — the decision table above may be stale.
---
Step 3 — Canonical example (approval gate)
Starting point for any HITL task. Adapt by swapping the class name and params per Step 2.
from airflow.providers.standard.operators.hitl import ApprovalOperator
from airflow.sdk import dag, task, chain, Param
from pendulum import datetime
@dag(start_date=datetime(2025, 1, 1), schedule="@daily")
def approval_example():
@task
def prepare():
return "Review quarterly report"
approval = ApprovalOperator(
task_id="approve_report",
subject="Report Approval",
body="{{ ti.xcom_pull(task_ids='prepare') }}",
defaults="Approve", # Auto-selected on timeout
params={"comments": Param("", type="string")},
)
@task
def after_approval(result):
print(f"Decision: {result['chosen_options']}")
chain(prepare(), approval)
after_approval(approval.output)
approval_example()For the other classes in Step 1, the shape is the same (task_id, subject, plus class-specific params). Verify each constructor through Step 2 — for example, HITLBranchOperator requires every option either to match a downstream task id directly or to be resolved via a mapping param surfaced in the registry.
---
Step 4 — Behavior contracts (stable across versions)
Timeout
- With
defaultsset: task succeeds on timeout, default option(s) selected. - Without
defaults: task fails on timeout.
Markdown + Jinja in body
body supports Markdown and is Jinja-templatable. Render XCom context directly:
body = """**Total Budget:** {{ ti.xcom_pull(task_ids='get_budget') }}
| Category | Amount |
|----------|--------|
| Marketing | $1M |
"""Callbacks
All HITL operators accept the standard Airflow callback kwargs (on_success_callback, on_failure_callback, etc.).
Notifiers
HITL operators accept a notifiers list. Inside a notifier's notify(context) method, build a link to the pending task with HITLOperator.generate_link_to_ui_from_context(context, base_url=...).
Restricting who can respond
The parameter name and accepted identifier format depend on the active auth manager. Do not hardcode — check which one is active and which kwarg the current provider exposes:
af config show | jq '.auth_manager // .core.auth_manager'Then look up the current kwarg in Step 2 (at the time of writing it is assigned_users, accepting identifiers in whatever format the active auth manager uses — Astro uses the Astro user ID, FabAuthManager uses email, SimpleAuthManager uses username).
---
Step 5 — Responding from external integrations
For Slack bots, custom apps, or scripts. Discover the live endpoint rather than hardcoding a path:
af api ls --filter hitl # live endpoint list
af api spec \
| jq '.paths | to_entries[] | select(.key | test("hitl"))' # request/response schemasThe PATCH-to-respond pattern is stable; the exact path is discovered. Typical shape:
import os, requests
HOST = os.environ["AIRFLOW_HOST"]
TOKEN = os.environ["AIRFLOW_API_TOKEN"]
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
# List pending — use the path from `af api ls --filter hitl`
requests.get(f"{HOST}/<path>", headers=HEADERS, params={"state": "pending"})
# Respond — same discovered path family, PATCH
requests.patch(
f"{HOST}/<path>/{dag_id}/{run_id}/{task_id}",
headers=HEADERS,
json={"chosen_options": ["Approve"], "params_input": {"comments": "ok"}},
)---
Step 6 — Safety checks
- [ ] Airflow version ≥ 3.1 (
af config version). - [ ] Constructor kwargs match the current registry output from Step 2 — no
respondents-vs-assigned_usersstyle drift. - [ ] For branching: every option resolves to a downstream task id (directly or via the mapping kwarg from Step 2).
- [ ] Every value in
defaultsis also inoptions. - [ ]
execution_timeoutset;defaultsconfigured if timeout should succeed rather than fail. - [ ] API token configured if external responders are part of the flow.
---
References
The upstream docs URL is surfaced per-module by the registry — do not hardcode:
af registry modules standard \
| jq '.modules[] | select(.import_path | test("\\.hitl\\.")) | {name, docs_url}'Related skills
- airflow —
af registry,af api,af configcommand reference. - airflow-ai — AI/LLM task decorators and GenAI patterns.
- authoring-dags — general DAG writing best practices.
- testing-dags — iterative test → debug → fix cycles.
Related skills
FAQ
Which Airflow version does airflow-hitl require?
airflow-hitl requires Apache Airflow 3.1 or newer. Verify with af config version before adding ApprovalOperator, HITLOperator, or HITLBranchOperator to DAGs.
Do HITL operators block Airflow workers while waiting?
No—airflow-hitl uses deferrable HITL operators that release worker slots while paused. Humans respond via the Airflow UI Required Actions tab or REST API until the task resumes.
Is Airflow Hitl safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.