Three triggers for three situations
| Situation at ShopKart | Trigger | Pipeline |
|---|---|---|
| Run the nightly job at 6 a.m. India time | Schedule | PL_Master_Daily |
| Copy orders hour by hour, backfilling from midnight | Tumbling window | PL_Process_Window |
| Copy a supplier file the moment it lands | Storage event | PL_Copy_Supplier_File |
Schedule trigger
{
"name": "TR_Daily_6AM_IST",
"properties": {
"description": "Every day at 6:00 a.m. India time.",
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "PL_Master_Daily",
"type": "PipelineReference"
}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Day",
"interval": 1,
"startTime": "2026-11-23T06:00:00",
"timeZone": "India Standard Time",
"schedule": {
"hours": [
6
],
"minutes": [
0
]
}
}
}
}
}timeZone: "India Standard Time" means 6 a.m. IST, not UTC. Without a time zone, times are UTC, and that's the classic โwhy did it run at 11:30 a.m.?โ bug (6:00 UTC = 11:30 IST). schedule can list several hours, minutes, weekdays or month days.
Tumbling window trigger
A tumbling window cuts time into fixed, back-to-back slots (here one hour) and runs the pipeline once per slot, passing the slot's start and end:
{
"name": "TR_Hourly_Window",
"properties": {
"description": "One run per hour, with that hour's start and end passed to the pipeline. Can backfill the past.",
"runtimeState": "Started",
"pipeline": {
"pipelineReference": {
"referenceName": "PL_Process_Window",
"type": "PipelineReference"
},
"parameters": {
"windowStart": "@trigger().outputs.windowStartTime",
"windowEnd": "@trigger().outputs.windowEndTime"
}
},
"type": "TumblingWindowTrigger",
"typeProperties": {
"frequency": "Hour",
"interval": 1,
"startTime": "2026-11-22T00:00:00Z",
"delay": "00:10:00",
"maxConcurrency": 4,
"retryPolicy": {
"count": 3,
"intervalInSeconds": 300
},
"dependsOn": []
}
}
}{
"name": "PL_Process_Window",
"properties": {
"description": "Copy one hour of orders. Run by the tumbling window trigger, one run per hour window.",
"parameters": {
"windowStart": {
"type": "string"
},
"windowEnd": {
"type": "string"
}
},
"activities": [
{
"name": "Copy Window",
"type": "Copy",
"policy": {
"retry": 3,
"retryIntervalInSeconds": 300
},
"typeProperties": {
"source": {
"type": "AzureSqlSource",
"sqlReaderQuery": {
"value": "SELECT * FROM dbo.orders WHERE updated_at >= '@{pipeline().parameters.windowStart}' AND updated_at < '@{pipeline().parameters.windowEnd}'",
"type": "Expression"
}
},
"sink": {
"type": "ParquetSink"
}
},
"inputs": [
{
"referenceName": "DS_AzureSql_Query",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "DS_ADLS_Parquet",
"type": "DatasetReference",
"parameters": {
"folderPath": {
"value": "@concat('raw/orders_hourly/', formatDateTime(pipeline().parameters.windowStart, 'yyyy/MM/dd/HH'))",
"type": "Expression"
},
"fileName": {
"value": "@concat('orders_', formatDateTime(pipeline().parameters.windowStart, 'yyyyMMddHH'), '.parquet')",
"type": "Expression"
}
}
}
]
}
]
}
}The trigger turns @trigger().outputs.windowStartTime into the pipeline's windowStart parameter. We evaluated the pipeline for the first three windows a backfill from midnight would create:
from data_factory_testing_framework import TestFramework, TestFrameworkType
from data_factory_testing_framework.state import RunParameter, RunParameterType
tf = TestFramework(framework_type=TestFrameworkType.DataFactory, root_folder_path="shopkart-adf")
pipeline = tf.get_pipeline_by_name("PL_Process_Window")
# The tumbling window trigger passes each hour's start and end. Three windows from a backfill:
for start, end in [("2026-11-22T00:00:00Z", "2026-11-22T01:00:00Z"),
("2026-11-22T01:00:00Z", "2026-11-22T02:00:00Z"),
("2026-11-22T02:00:00Z", "2026-11-22T03:00:00Z")]:
[copy] = tf.evaluate_pipeline(pipeline, [RunParameter(RunParameterType.Pipeline, "windowStart", start),
RunParameter(RunParameterType.Pipeline, "windowEnd", end)])
out = copy.all_properties["outputs"][0]["parameters"]
print(copy.type_properties["source"]["sqlReaderQuery"].result)
print(" โ", out["folderPath"].result + "/" + out["fileName"].result)SELECT * FROM dbo.orders WHERE updated_at >= '2026-11-22T00:00:00Z' AND updated_at < '2026-11-22T01:00:00Z'
โ raw/orders_hourly/2026/11/22/00/orders_2026112200.parquet
SELECT * FROM dbo.orders WHERE updated_at >= '2026-11-22T01:00:00Z' AND updated_at < '2026-11-22T02:00:00Z'
โ raw/orders_hourly/2026/11/22/01/orders_2026112201.parquet
SELECT * FROM dbo.orders WHERE updated_at >= '2026-11-22T02:00:00Z' AND updated_at < '2026-11-22T03:00:00Z'
โ raw/orders_hourly/2026/11/22/02/orders_2026112202.parquetEach window copies exactly its hour, into its own folder. Because the start time is in the past, ADF creates runs for every missed window (backfill), up to maxConcurrency at a time. A failed window retries on its own (retryPolicy) without touching the others, and delay waits 10 minutes after each hour ends so late rows arrive first.
Storage event trigger
{
"name": "TR_Supplier_File_Arrived",
"properties": {
"description": "Run as soon as the supplier uploads a CSV.",
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "PL_Copy_Supplier_File",
"type": "PipelineReference"
},
"parameters": {
"fileName": "@triggerBody().fileName"
}
}
],
"type": "BlobEventsTrigger",
"typeProperties": {
"blobPathBeginsWith": "/supplier-drop/blobs/incoming/",
"blobPathEndsWith": ".csv",
"ignoreEmptyBlobs": true,
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-shopkart-dev/providers/Microsoft.Storage/storageAccounts/stsupplierdrop",
"events": [
"Microsoft.Storage.BlobCreated"
]
}
}
}When a .csv is created under supplier-drop/incoming/, Azure Event Grid tells ADF, and the pipeline starts with @triggerBody().fileName as its parameter. It needs the Microsoft.EventGrid resource provider registered in the subscription. Big uploads can fire before a file is fully written by some tools; suppliers that write a temporary name and rename at the end avoid that.
Compare them
| Schedule | Tumbling window | Storage event | |
|---|---|---|---|
| Pipelines per trigger | Many | One | Many |
| Past runs (backfill) | No | Yes | No |
| Passes time window | scheduledTime only | windowStart / windowEnd | fileName / folderPath |
| Retry policy on trigger | No (use activity retries) | Yes | No |
| Dependencies between triggers | No | Yes (window depends on window) | No |
| Concurrency control | No | maxConcurrency | No |
๐ฏ Interview questions on this topic
Try to answer out loud first, then tap to check.
Q1What types of triggers does ADF have?Fresher+
Q2Schedule vs tumbling window trigger?1โ3 yrs+
Q3How do you process a file as soon as it arrives?1โ3 yrs+
Q4You need to reload 3 months of hourly data after a bug fix. How?3+ yrs+
Key takeaways
- โMatch the trigger to how data arrives: clock, time slices or files.
- โTumbling windows make backfills and per-hour retries easy.
- โAlways pass trigger times as parameters for repeatable runs.
- โPublish and start, and set the time zone.
Frequently asked questions
Schedule trigger or tumbling window trigger?
Schedule for 'run at these times' jobs (daily at 6 a.m.) that can start several pipelines. Tumbling window for time-sliced data loads: each run owns one fixed window (say an hour), gets its start and end as parameters, can backfill past windows, retry failed windows and depend on other windows.
Why didn't my trigger fire?
Most often it was never published or started (triggers only run from the published factory and must be in Started state), the start time is in the future, the time zone is wrong, or for storage events the Microsoft.EventGrid resource provider isn't registered in the subscription.
Can one pipeline have several triggers?
Yes. And a schedule trigger can start several pipelines. A tumbling window trigger is tied to exactly one pipeline.
How do I pass the trigger time to my pipeline?
Map trigger values to pipeline parameters: @trigger().scheduledTime or @trigger().startTime for schedule triggers, @trigger().outputs.windowStartTime / windowEndTime for tumbling windows, and @triggerBody().fileName / folderPath for storage events.
๐ง Quick check: triggers
1. You must reload the past 30 days, one day at a time, with retries. Which trigger?
2. What does @triggerBody().fileName give a storage event trigger's pipeline?
3. Our hourly window starting 2026-11-22T01:00:00Z wrote to...
4. A trigger shows in Studio but never runs. First check?
Checking your accessโฆ