
SurrealDB Trigger
CertifiedTrigger Flow when SurrealDB query returns rows
SurrealDB Trigger
Trigger Flow when SurrealDB query returns rows
Polls a SurrealQL query on a fixed interval (default 1 minute) and starts the Flow when it returns at least one row. Defaults to fetchType: STORE, which uploads results to internal storage; use FETCH or FETCH_ONE to surface rows on trigger. TLS is disabled by default; keep credentials in secrets.
type: io.kestra.plugin.surrealdb.TriggerExamples
Wait for SurrealQL query to return results, and then iterate through rows.
id: surrealdb_trigger
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.rows }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ fromJson(taskrun.value) }}"
triggers:
- id: watch
type: io.kestra.plugin.surrealdb.Trigger
interval: "PT5M"
host: localhost
port: 8000
username: surreal_user
password: "{{ secret('SURREALDB_PASSWORD') }}"
namespace: surreal_namespace
database: surreal_db
fetchType: FETCH
query: SELECT * FROM SURREAL_TABLE
Properties
database *Requiredstring
1Connection database
host *Requiredstring
1Connection host
namespace *Requiredstring
1Connection namespace
query *Requiredstring
1SurrealQL query text
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
connectionTimeout Non-dynamicinteger
60> Connection timeout
Timeout for opening the connection in seconds; default is 60.
fetchType string
STORESTOREFETCHFETCH_ONENONEResult handling mode
Controls how query results are returned. FETCH_ONE outputs the first row, FETCH outputs all rows, STORE writes rows to internal storage, NONE skips output creation.
interval Non-dynamicstring
PT1MdurationPolling interval
Time between query executions; default 1 minute.
parameters object
{}Named query parameters
SurrealQL prepared-statement parameters rendered before execution. Provide a map of named placeholders to values.
password string
Plaintext authentication password
port Non-dynamicinteger
8000> Connection port
TCP port for the SurrealDB endpoint; default is 8000.
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
useTls booleanstring
falseEnable TLS for connection
Use TLS when connecting to SurrealDB; default is false.
username string
Plaintext authentication username
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.