Query icon
Script icon
Docker icon
Create icon
Schedule icon

Daily Snowflake Digest as a Slack Canvas

Schedule a Snowflake query, render the metrics as Markdown, and publish an editable Slack Canvas your team can annotate, all orchestrated in Kestra.

Categories
BusinessData

Turn a daily Snowflake query into a living, editable team document. This blueprint reads your headline metrics from Snowflake, formats them into clean Markdown, and publishes a Slack Canvas that your team can read and annotate, instead of a transient chat message that scrolls out of sight. It solves the recurring problem of stale, copy-pasted dashboards and metric snapshots that nobody can update in place.

How it works

  1. A io.kestra.plugin.core.trigger.Schedule trigger (daily_digest, cron 0 7 * * *, shipped disabled: true) fires the flow each morning.
  2. The query_metrics task (io.kestra.plugin.jdbc.snowflake.Query) runs your SQL against Snowflake using the snowflake_url input with fetchType: FETCH, returning the metric rows.
  3. The format_markdown task (io.kestra.plugin.scripts.python.Script, running on the Docker task runner with the python:3.11-slim image) reads the rows and renders a Markdown digest, exposed via Kestra.outputs.
  4. The publish_canvas task (io.kestra.plugin.slack.app.canvases.Create) creates an editable Slack Canvas titled with the execution date and the rendered Markdown content.

What you get

  • A scheduled, hands-off Snowflake to Slack reporting pipeline.
  • An editable Slack Canvas rather than a throwaway message.
  • A clean separation of query, formatting, and publishing logic.
  • Dated digests via execution.startDate, so each run is traceable.

Who it's for

  • Data and analytics engineers automating recurring reporting.
  • Operations and business teams who live in Slack.
  • Anyone replacing manual screenshot-and-paste metric updates.

Why orchestrate this with Kestra

Snowflake tasks and Slack scopes can each do their part, but neither owns the end-to-end flow. Kestra wires them together with an event-driven Schedule trigger, automatic retries on transient failures, full execution lineage across the query, transform, and publish steps, and a single declarative YAML definition. The Snowflake scheduler can run SQL, but it cannot transform results in Python and push an editable Canvas into Slack on the same cadence. Kestra fills that gap.

Prerequisites

  • A Snowflake table (for example daily_metrics) holding the metrics to publish.
  • A Slack app with Canvas permissions.

Secrets

  • SNOWFLAKE_USERNAME: Snowflake user.
  • SNOWFLAKE_PASSWORD: Snowflake password.
  • SLACK_TOKEN: Slack token with the canvases:write scope.

Quick start

  1. Set SNOWFLAKE_USERNAME, SNOWFLAKE_PASSWORD, and SLACK_TOKEN in your Kestra namespace.
  2. Point the snowflake_url input at your account, warehouse, and database.
  3. Adjust the SQL in query_metrics and the Markdown formatting in format_markdown to match your metrics.
  4. Enable the daily_digest trigger (remove disabled: true) or run the flow manually.

How to extend

  • Post the Canvas link to a channel after creation for visibility.
  • Add multiple queries and sections (KPIs, anomalies, trends) to the digest.
  • Branch the schedule into daily, weekly, and monthly variants.
  • Add an errors task to alert on failed runs.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.