
Databricks Lakebase Trigger
CertifiedWait for query results on Databricks Lakebase and trigger a flow
Databricks Lakebase Trigger
Wait for query results on Databricks Lakebase and trigger a flow
Periodically mints a fresh Lakebase OAuth credential and polls a SQL query. The trigger fires
when the query returns at least one row. Default interval is one minute. Use fetchType to control
how matching rows are exposed on the execution (trigger.rows, trigger.row, or trigger.uri).
type: io.kestra.plugin.databricks.lakebase.TriggerExamples
React to newly inserted rows
id: lakebase_new_rows_trigger
namespace: company.team
triggers:
- id: on_new_order
type: io.kestra.plugin.databricks.lakebase.Trigger
workspaceHost: "{{ secret('DATABRICKS_HOST') }}"
clientId: "{{ secret('DATABRICKS_CLIENT_ID') }}"
clientSecret: "{{ secret('DATABRICKS_CLIENT_SECRET') }}"
endpoint: "{{ secret('LAKEBASE_ENDPOINT_NAME') }}"
database: "orders_db"
sql: "SELECT * FROM orders WHERE status = 'pending'"
interval: PT1M
tasks:
- id: handle_new_order
type: io.kestra.plugin.core.log.Log
message: "New pending order: {{ trigger.rows }}"
Properties
clientId *string
OAuth M2M client ID
Service principal client ID (UUID). Also used as the Postgres username when connecting to Lakebase.
clientSecret *string
OAuth M2M client secret
Service principal OAuth secret used to mint a short-lived Lakebase database credential. Render from secrets.
database *string
Postgres database name
Database to open after authentication, e.g. databricks_postgres or orders_db
endpoint *string
Lakebase endpoint resource name
Passed to generateDatabaseCredential. Format: projects/
sql *string
SQL query to poll
The trigger fires when this query returns at least one row
workspaceHost *string
Databricks workspace host
Workspace URL used by the Databricks SDK to mint a Lakebase database credential, e.g. https://
afterSQL string
SQL to execute after a successful poll in the same transaction
Optional single statement used to mark processed rows so the next poll does not re-fire on the same data
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
fetchType string
FETCHSTOREFETCHFETCH_ONENONEResult fetching mode
Triggers default to FETCH. NONE is rejected because the trigger would never fire. Use FETCH, FETCH_ONE, or STORE.
host string
Lakebase Postgres hostname
Optional. When omitted, the hostname is resolved from the endpoint via the Databricks Postgres API (status.hosts.host).
interval string
PT1MdurationInterval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
parameters object
Named parameter bindings
Map of parameter names to values. Use : name placeholders in SQL.
port integerstring
5432Lakebase Postgres port
Defaults to 5432
ssl booleanstring
trueEnable SSL
Lakebase requires SSL. Defaults to true.
sslCert string
SSL client certificate
PEM-encoded client certificate written to a temp file and passed to the Postgres driver as sslcert
sslKey string
SSL client key
PEM-encoded client key written to a temp file and passed to the Postgres driver as sslkey
sslKeyPassword string
SSL client key password
sslMode string
REQUIREDISABLEALLOWPREFERREQUIREVERIFY_CAVERIFY_FULLSSL mode
Postgres sslmode. Defaults to REQUIRE, which is the Lakebase-recommended setting.
sslRootCert string
SSL root certificate
PEM-encoded CA certificate written to a temp file and passed to the Postgres driver as sslrootcert
stopAfter array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
timeZoneId string
Time zone for temporal values
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
Outputs
row object
First fetched row
Present when fetchType is FETCH_ONE
rows array
Fetched rows
Present when fetchType is FETCH
size integer
Number of fetched rows
uri string
uriResult file URI
Internal storage URI of the Ion file when fetchType is STORE