New to Kestra?
Use blueprints to kickstart your first workflows.
Change driven Kestra pipeline that polls a Snowflake stream, batch loads new rows into Postgres in parallel, runs dbt, and posts Slack alerts on failure.
React to changes in Snowflake instead of guessing when data arrives. This Kestra blueprint polls a Snowflake stream, and whenever new rows appear it starts an execution that loads each row batch into Postgres with efficient batch inserts and then runs your dbt project to transform the raw data downstream. Because Snowflake streams only return changed rows since the last consumption, the flow processes deltas rather than full table scans, and flow level concurrency, retries, and Slack alerting make the pipeline safe to run unattended.
sf trigger (io.kestra.plugin.jdbc.snowflake.Trigger) connects with key pair authentication every five minutes and runs select * from streams.my_snowflake_stream on the COMPUTE_WH warehouse. When the stream returns rows, an execution starts with the rows stored as trigger output.concurrency (behavior: QUEUE, limit: 1) makes sure two polls never process overlapping data at the same time.each task (io.kestra.plugin.core.flow.ForEach) iterates over trigger.rows with concurrencyLimit: 2.jsonToIon (io.kestra.plugin.serdes.json.JsonToIon) normalizes the payload and insert_raw_data (io.kestra.plugin.jdbc.postgresql.Batch) streams it into raw_events with a parameterized insert.dbt task (io.kestra.plugin.dbt.cli.Run) runs your dbt project from namespace files inside the ghcr.io/kestra-io/dbt-postgres container, with the Postgres profile rendered from secrets.retry policy retries failed tasks three times, and the errors branch posts to Slack through io.kestra.plugin.slack.notifications.SlackIncomingWebhook if the execution still fails.Consuming a Snowflake stream correctly means tracking offsets, scheduling polls, handling partial failures, and alerting, all of which is bespoke code without an orchestrator. Kestra's JDBC trigger encapsulates the polling loop, ForEach gives bounded fan out, flow concurrency prevents overlapping consumption, and retries plus the errors branch turn failure handling into configuration. Every execution shows exactly which rows were picked up and what dbt did with them.
streams.my_snowflake_stream) and a user configured for key pair authentication.SNOWFLAKE_URL: JDBC connection URL for your Snowflake account.SNOWFLAKE_PRIVATE_KEY, SNOWFLAKE_PRIVATE_KEY_PASSWORD: key pair credentials for the trigger.JDBC_CONNECTION_STRING, PG_USERNAME, PG_PASSWORD, PG_HOST, PG_PORT: Postgres connection for the load and the dbt profile.SLACK_WEBHOOK: incoming webhook URL for failure alerts.interval for fresher syncs, or switch to a Snowflake task plus webhook for push semantics.io.kestra.plugin.dbt.cli.Test after the run to validate models before consumers read them.io.kestra.plugin.core.flow.Switch based on a type column.Query task that counts inserted rows per execution.