/snowflake-pack:snowflake-webhooks-eventsfrom snowflake-pack
Implements Snowflake event-driven patterns: alerts, email notifications, external functions, and notification integrations. Use when setting up automated pipelines triggered by Snowflake data changes.
Ships in snowflake-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Snowflake uses alerts, email notifications, external functions, and notification integrations for event-driven patterns (not traditional webhooks).
CREATE ALERT privilege-- Alert when daily revenue drops below threshold
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',
'[email protected]',
'Revenue Alert: Below 50% of 30-day average',
'Daily revenue has dropped significantly. Check dashboard.'
);
ALTER ALERT revenue_drop_alert RESUME;
-- Alert when warehouse credits exceed daily budget
CREATE OR REPLACE ALERT credit_usage_alert
WAREHOUSE = ANALYTICS_WH
SCHEDULE = '30 MINUTE'
IF (EXISTS (
SELECT 1
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time >= CURRENT_DATE()
GROUP BY ALL
HAVING SUM(credits_used) > 100 -- Daily budget: 100 credits
))
THEN
CALL SYSTEM$SEND_EMAIL(
'ops_notifications',
'[email protected]',
'Snowflake Credit Alert',
'Daily credit usage has exceeded 100 credits.'
);
-- Monitor alert history
SELECT *
FROM TABLE(INFORMATION_SCHEMA.ALERT_HISTORY(
SCHEDULED_TIME_RANGE_START => DATEADD(hours, -24, CURRENT_TIMESTAMP())
))
ORDER BY scheduled_time DESC;
-- Set up email notification integration
CREATE OR REPLACE NOTIFICATION INTEGRATION email_notifications
TYPE = EMAIL
ENABLED = TRUE
ALLOWED_RECIPIENTS = (
'[email protected]',
'[email protected]',
'[email protected]'
);
-- Send email from stored procedure
CREATE OR REPLACE PROCEDURE send_data_quality_report()
RETURNS VARCHAR
LANGUAGE SQL
AS
$$
BEGIN
LET row_count INTEGER;
SELECT COUNT(*) INTO :row_count
FROM orders WHERE order_date = CURRENT_DATE() AND amount IS NULL;
IF (row_count > 0) THEN
CALL SYSTEM$SEND_EMAIL(
'email_notifications',
'[email protected]',
'Data Quality Issue: NULL amounts detected',
row_count || ' orders have NULL amounts today.'
);
RETURN 'Alert sent for ' || row_count || ' records';
END IF;
RETURN 'No issues found';
END;
$$;
-- Create API integration for external function
CREATE OR REPLACE API INTEGRATION my_api_integration
API_PROVIDER = aws_api_gateway
API_AWS_ROLE_ARN = 'arn:aws:iam::123456789:role/snowflake-api-role'
ENABLED = TRUE
API_ALLOWED_PREFIXES = ('https://api.execute-api.us-east-1.amazonaws.com/');
-- Create external function that calls your API
CREATE OR REPLACE EXTERNAL FUNCTION notify_slack(message VARCHAR)
RETURNS VARIANT
API_INTEGRATION = my_api_integration
AS 'https://api.execute-api.us-east-1.amazonaws.com/prod/slack-notify';
-- Use in a task to notify on data changes
CREATE OR REPLACE TASK notify_new_high_value_orders
WAREHOUSE = ANALYTICS_WH
SCHEDULE = '15 MINUTE'
WHEN SYSTEM$STREAM_HAS_DATA('orders_stream')
AS
SELECT notify_slack(
'New high-value order: $' || amount || ' from customer ' || customer_id
)
FROM orders_stream
WHERE METADATA$ACTION = 'INSERT' AND amount >= 10000;
-- S3 event notification for auto-ingest (Snowpipe)
-- This triggers when new files land in S3
CREATE OR REPLACE PIPE auto_ingest_pipe
AUTO_INGEST = TRUE
AS
COPY INTO raw_events
FROM @my_s3_stage/events/
FILE_FORMAT = my_json_format;
-- Get the SQS queue ARN to configure S3 event notifications
SHOW PIPES LIKE 'auto_ingest_pipe';
-- Copy notification_channel value → S3 bucket event configuration
-- GCS pub/sub notification
CREATE OR REPLACE NOTIFICATION INTEGRATION gcs_notification
TYPE = QUEUE
NOTIFICATION_PROVIDER = GCP_PUBSUB
ENABLED = TRUE
GCP_PUBSUB_SUBSCRIPTION_NAME = 'projects/my-project/subscriptions/snowflake-sub';
// src/snowflake/event-processor.ts
// Poll for changes using streams (app-side consumption)
interface OrderEvent {
ORDER_ID: number;
CUSTOMER_ID: number;
AMOUNT: number;
METADATA$ACTION: 'INSERT' | 'DELETE';
}
async function processOrderEvents(conn: snowflake.Connection) {
// Check if stream has data
const hasData = await query<{ HAS_DATA: boolean }>(conn,
"SELECT SYSTEM$STREAM_HAS_DATA('orders_stream') AS HAS_DATA"
);
if (!hasData.rows[0]?.HAS_DATA) return;
// Consume stream within a transaction
await query(conn, 'BEGIN');
try {
const events = await query<OrderEvent>(conn,
'SELECT * FROM orders_stream'
);
for (const event of events.rows) {
if (event.METADATA$ACTION === 'INSERT' && event.AMOUNT >= 10000) {
await notifySlack(`High-value order: $${event.AMOUNT}`);
}
}
// Advance the stream offset by writing to target
await query(conn, `
INSERT INTO processed_orders
SELECT order_id, customer_id, amount, CURRENT_TIMESTAMP()
FROM orders_stream WHERE METADATA$ACTION = 'INSERT'
`);
await query(conn, 'COMMIT');
} catch (err) {
await query(conn, 'ROLLBACK');
throw err;
}
}
| Issue | Cause | Solution |
|---|---|---|
| Alert not firing | Alert suspended | ALTER ALERT x RESUME |
| Email not delivered | Recipient not in allowlist | Add to ALLOWED_RECIPIENTS |
| External function timeout | API too slow | Increase timeout, check API health |
| Snowpipe not triggering | S3 event config missing | Configure SQS notification from SHOW PIPES |
| Stream data loss | Stream stale | Recreate stream, increase retention |
For performance optimization, see snowflake-performance-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
30 skills in this plugin
/snowflake-advanced-troubleshootingApply advanced Snowflake debugging with query profiling, spill analysis,
lock contention, and performance deep-dives using ACCOUNT_USAGE views.
Use when standard troubleshooting fails, investigating slow queries,
or diagnosing warehouse performance issues.
Trigger with phrases like "snowflake hard bug", "snowflake slow query debug",
"snowflake query profile", "snowflake spilling", "snowflake deep debug".
/snowflake-architecture-variantsChoose and implement Snowflake architecture blueprints: data lakehouse, data mesh,
data sharing, and Snowpark-native patterns for different scales.
Use when designing Snowflake data platforms, choosing between architectures,
or implementing data sharing and Snowpark patterns.
Trigger with phrases like "snowflake architecture", "snowflake lakehouse",
"snowflake data mesh", "snowflake data sharing", "snowflake Snowpark".
/snowflake-ci-integrationConfigure Snowflake CI/CD with GitHub Actions, SchemaChange, and Terraform.
Use when setting up automated schema migrations, CI pipelines for Snowflake,
or integrating SchemaChange/Terraform into your deployment workflow.
Trigger with phrases like "snowflake CI", "snowflake GitHub Actions",
"snowflake SchemaChange", "snowflake terraform", "snowflake CI/CD".
/snowflake-common-errorsDiagnose and fix common Snowflake errors and SQL compilation failures.
Use when encountering Snowflake error codes, failed queries,
authentication issues, or warehouse/connection problems.
Trigger with phrases like "snowflake error", "fix snowflake",
"snowflake not working", "snowflake SQL error", "snowflake 002003".
/snowflake-core-workflow-aExecute Snowflake primary workflow: data loading via stages and COPY INTO.
Use when loading data from S3/GCS/Azure into Snowflake tables,
setting up Snowpipe for continuous ingestion, or bulk loading files.
Trigger with phrases like "snowflake load data", "snowflake COPY INTO",
"snowflake stage", "snowflake ingest", "snowflake S3 load", "snowpipe".
/snowflake-core-workflow-bExecute Snowflake data transformation with streams, tasks, and dynamic tables.
Use when building ELT pipelines, scheduling transformations,
or implementing change data capture with Snowflake streams.
Trigger with phrases like "snowflake transform", "snowflake ELT",
"snowflake stream", "snowflake task", "snowflake pipeline",
"snowflake dynamic table", "snowflake CDC".
npx claudepluginhub flight505/skill-forge --plugin snowflake-packOther plugins' skills for the same job