Data Pipeline Automation in Snowflake
Emily Melhuish
Technical Curriculum Developer, Snowflake
Dynamic Tables:

Streams and tasks:

Declarative pipeline automation
SELECT query — describe the result, Snowflake manages the refreshCREATE DYNAMIC TABLE logistics.delivery_summary
TARGET_LAG = '1 hour'
WAREHOUSE = harbr_wh
AS
SELECT region, COUNT(*) AS shipments,
AVG(delivery_days) AS avg_days
FROM logistics.shipments GROUP BY region;
The freshness contract between you and Snowflake
| TARGET_LAG value | Effect |
|---|---|
'5 minutes' |
Table is never more than 5 minutes stale - refreshes frequently |
'1 hour' |
Refreshes less often - lower compute consumption |
DOWNSTREAM |
Infer lag from downstream dependents - ideal for chained tables |
Incremental refresh
-- Incremental-friendly:
SELECT region, COUNT(*) AS shipments
FROM logistics.shipments
GROUP BY region;
Full refresh

DOWNSTREAM lag defers to what the next table needs - no over-refreshingDynamic tables: declarative
-- Declare the result for Snowflake
CREATE DYNAMIC TABLE logistics.summary
TARGET_LAG = '1 hour'
WAREHOUSE = harbr_wh
AS SELECT region, COUNT(*)
FROM shipments
GROUP BY 1;
Streams + Tasks: imperative
-- You control every step
CREATE TASK process_events
SCHEDULE = '5 MINUTE'
WHEN SYSTEM$STREAM_HAS_DATA
('events_stream')
AS CALL logistics.process_new_events();
SELECT name, state, refresh_start_time, refresh_end_time
FROM TABLE (
INFORMATION_SCHEMA.DYNAMIC_TABLE_REFRESH_HISTORY (
NAME_PREFIX => 'HARBR_DB.DELIVERY_SUMMARY.', ERROR_ONLY => TRUE
)
)
ORDER BY name, data_timestamp;
| NAME | TRIGGER | STATE | START | END |
|---|---|---|---|---|
| DELIVERY_SUMMARY | SCHEDULED | SUCCEEDED | 2026-03-01 05:00:00 | 2024-03-01 05:00:08 |
| DELIVERY_SUMMARY | SCHEDULED | FAILED | 2026-03-01 04:00:00 | 2024-03-01 04:00:03 |
Data Pipeline Automation in Snowflake