SurrealDB Trigger

SurrealDB Trigger

Certified

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. Supports non-array query results (objects and scalars). 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.

yaml
type: io.kestra.plugin.surrealdb.Trigger

Wait for SurrealQL query to return results, and then iterate through rows.

yaml
id: surrealdb_trigger
namespace: company.team

tasks:
  - id: each
    type: io.kestra.plugin.core.flow.ForEach
    values: "{{ trigger.rows }}"
    tasks:
      - id: log_row
        type: io.kestra.plugin.core.log.Log
        message: "{{ 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
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-surrealdb --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties
Min length1

Connection database

Min length1

Connection host

Min length1

Connection namespace

Min length1

SurrealQL query text

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Default60
Minimum>

Connection timeout

Timeout for opening the connection in seconds; default is 60.

DefaultSTORE
Possible Values
STOREFETCHFETCH_ONENONE

Result 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.

DefaultPT1M
Formatduration

Polling interval

Time between query executions; default 1 minute.

Default{}

Named query parameters

SurrealQL prepared-statement parameters rendered before execution. Provide a map of named placeholders to values.

Plaintext authentication password

Default8000

Connection port

TCP port of the SurrealDB endpoint, from 1 to 65535; default 8000.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaultfalse

Enable TLS for connection

Use TLS when connecting to SurrealDB; default is false.

Plaintext authentication username

Defaulttrue

A 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.