New to Kestra?
Use blueprints to kickstart your first workflows.
Watch a SAP HANA transactions table for high-value rows and alert finance in Slack with Kestra, marking each row only after the alert lands.
Turn a SAP HANA transactions table into a near real-time event source for treasury monitoring. This
event-driven flow watches FINANCE.TRANSACTIONS for new high-value rows in a specific currency and
posts a formatted Slack alert to the finance team the moment any appear, with no polling loop to
maintain in application code. The hard problem it solves is safe delivery: rows are flagged as
alerted only after the Slack post succeeds and only for the exact transaction ids that were fetched,
so a failed, throttled, or rate-limited alert never silently drops a high-value transaction.
io.kestra.plugin.jdbc.hana.Trigger polls SAP HANA every minute (interval: PT1M,
fetchType: FETCH) for rows matching AMOUNT >= :threshold AND CURRENCY = :currency AND ALERTED = FALSE, ordered by CREATED_AT and capped with LIMIT 100. The threshold and
currency are bound as SQL parameters, so the comparison is scoped to one currency and is never
currency-blind.trigger.rows and the count on trigger.size.alert_finance_team task (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts a
Slack Block Kit message with the match count and a masked row list. It retries with a constant
PT10S backoff up to three attempts.mark_alerted task (io.kestra.plugin.jdbc.hana.Query,
fetchType: NONE) flip ALERTED = TRUE, scoped to exactly the fetched TRANSACTION_IDs via
WHERE TRANSACTION_ID IN (...) rather than the open-ended predicate.errors block fires a second SlackIncomingWebhook with the
failing execution id.ALERTED marker column drains a first-run backlog at 100 rows per minute.SAP HANA has no native push-to-Slack capability, and its own scheduling cannot react row by row, post
to a webhook, retry on a 429, and then conditionally mark only the rows it just handled. Kestra closes
that gap: the database Trigger makes new rows an event, declarative YAML keeps the whole pipeline
versioned and reviewable, per-task retry blocks ride out Slack throttling, the errors block
guarantees a failure is itself surfaced, and full execution lineage records exactly which transactions
were alerted in each run.
databaseName=HXE; adjust the
instance number and database for your tenant. The SAP HANA driver (ngdbc) ships with the plugin.FINANCE.TRANSACTIONS table with TRANSACTION_ID, ACCOUNT_ID, AMOUNT, CURRENCY,
CREATED_AT, and a boolean ALERTED column. TRANSACTION_ID must be numeric for the scoped
IN (...) marking to bind safely. An index on (ALERTED, AMOUNT, CURRENCY) keeps the poll sargable.HANA_HOST: hostname or IP of the SAP HANA server.HANA_USERNAME: database user with SELECT and UPDATE on the transactions table.HANA_PASSWORD: password for that database user.SLACK_WEBHOOK: Slack Incoming Webhook URL for the finance alert channel and failure alerts.currency and threshold inputs (defaults USD and 100000).Query to join account or counterparty metadata before posting.