| name | snowflake-webhooks-events |
| description | Implement Snowflake event-driven patterns with alerts, notifications, and external functions.
Use when setting up Snowflake alerts, email notifications, external API calls,
or event-driven pipelines triggered by Snowflake data changes.
Trigger with phrases like "snowflake alerts", "snowflake notifications",
"snowflake events", "snowflake external function", "snowflake email".
|
| allowed-tools | Read, Write, Edit, Bash(curl:*) |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","data-warehouse","analytics","snowflake"] |
| compatibility | Designed for Claude Code |
Snowflake Webhooks & Events
Overview
Snowflake uses alerts, email notifications, external functions, and notification integrations for event-driven patterns (not traditional webhooks).
Prerequisites
- ACCOUNTADMIN or role with
CREATE ALERT privilege
- Email notification integration configured
- For external functions: API Gateway (AWS/GCP/Azure) configured
- For S3/GCS event notifications: Snowpipe configured
Instructions
Step 1: Snowflake Alerts (Built-in Event System)
CREATE OR REPLACE ALERT revenue_drop_alert
WAREHOUSE = ANALYTICS_WH
SCHEDULE = '60 MINUTE'
IF (EXISTS (
SELECT 1
FROM daily_order_metrics
WHERE metric_date = CURRENT_DATE()
AND total_revenue < (
SELECT AVG(total_revenue) * 0.5
FROM daily_order_metrics
WHERE metric_date BETWEEN DATEADD(days, -30, CURRENT_DATE())
AND DATEADD(days, -1, CURRENT_DATE())
)
))
THEN
CALL SYSTEM$SEND_EMAIL(
'revenue_notifications',
'oncall@company.com',
'Revenue Alert: Below 50% of 30-day average',
'Daily revenue has dropped significantly. Check dashboard.'
);
ALTER ALERT revenue_drop_alert RESUME;
REPLACE ALERT credit_usage_alert
WAREHOUSE ANALYTICS_WH
SCHEDULE
IF ( (
SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
start_time ()
(credits_used)
))
$SEND_EMAIL(
,
,
,
);
(INFORMATION_SCHEMA.ALERT_HISTORY(
SCHEDULED_TIME_RANGE_START DATEADD(hours, , ())
))
scheduled_time ;