Orchestrating dependencies in Airflow without sensors
Sensors burn worker slots to poll for things that could simply announce themselves. Datasets, deferrable operators and event-driven triggers do it better.
TL;DR
- A classic sensor occupies a worker slot while doing nothing — at scale, sensors are your capacity problem.
- Datasets (Airflow 2.4+) let a producer DAG schedule its consumers directly: no polling at all.
- When you must wait on something external, use deferrable operators/sensors so the wait happens in the triggerer, not a worker.
The problem
A platform team at NorthBridge Retail had 140 DAGs, and 60 of them started with an ExternalTaskSensor or an S3/ADLS key sensor. At 8 a.m., sensors held half the worker slots while actual work queued behind them.
Option 1 — Datasets: let the producer schedule the consumer
# producer DAG
from airflow.datasets import Dataset
silver_orders = Dataset("adls://lake/silver/orders")
load_orders = PythonOperator(
task_id="load_orders",
python_callable=load,
outlets=[silver_orders],
)# consumer DAG — no sensor, no schedule guessing
with DAG(
dag_id="build_gold_sales",
schedule=[silver_orders],
...
):
...The consumer runs when the data is updated — not at a time you hoped the producer would be done.
Option 2 — deferrable operators for external waits
Waiting on something Airflow doesn't produce (a vendor SFTP drop, an ADF pipeline)? Use the deferrable variant so the poll runs in the lightweight triggerer process:
wait_for_file = WasbBlobSensor(
task_id="wait_vendor_file",
container_name="inbound",
blob_name="vendor/{{ ds }}/orders.csv",
deferrable=True, # frees the worker slot while waiting
timeout=60 * 60 * 4,
)Option 3 — push, don't poll
If the upstream system can call a webhook, skip waiting entirely: an Azure Function or Logic App hits the Airflow REST API to trigger the DAG when the file lands. The DAG then starts with work, not with waiting.
Trade-offs
| Approach | Latency | Infra cost | Coupling |
|---|---|---|---|
| Classic sensor | poll interval | worker slot per wait | low |
| Dataset schedule | immediate | none | producer must be in Airflow |
| Deferrable sensor | poll interval | triggerer only | low |
| Event push | immediate | webhook plumbing | upstream must cooperate |
When not to use this
Tiny deployments with a handful of DAGs won't feel sensor pain; don't rebuild a working system for purity. Refactor when sensors start competing with real tasks for slots.
Further reading
Keep going
Parameterizing ADF pipelines across environments
One pipeline definition, three environments: global parameters, parameterized linked services and a metadata table — instead of dev/test/prod copy-paste.
ADF: tumbling window triggers are not schedule triggers
Tumbling windows are stateful — they backfill, retry per window and expose window start/end. Schedule triggers just fire and forget.
Lakeflow Jobs: Task Dependencies, Repair Runs and Triggers
Build a job graph that survives a bad night — run_if conditions for error handling, the five trigger types and their limits, and why repair runs only help idempotent tasks.
One practical note a week
Get new articles, problems and guides in your inbox.
Thanks! You're on the list. (Local demo — no email provider is wired up yet.)