Trigger
type: "io.kestra.plugin.surrealdb.Trigger"
Query a SurrealDB database on a regular interval to trigger flow on results.
Examples
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.EachSequential
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ json(taskrun.value) }}"
value: "{{ trigger.rows }}"
triggers:
- id: watch
type: io.kestra.plugin.surrealdb.Trigger
interval: "PT5M"
host: localhost
port: 8000
username: surreal_user
password: surreal_passwd
namespace: surreal_namespace
database: surreal_db
fetchType: FETCH
query: SELECT * FROM SURREAL_TABLE
Properties
database
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Min length:
1
Connection database.
fetchType
- Type: string
- Dynamic: ❌
- Required: ✔️
- Default:
STORE
- Possible Values:
STORE
FETCH
FETCH_ONE
NONE
The way you want to store data.
FETCH_ONE - output the first row. FETCH - output all rows as output variable. STORE - store all rows to a file. NONE - do nothing.
host
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Min length:
1
Connection host.
namespace
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Min length:
1
Connection namespace.
query
- Type: string
- Dynamic: ✔️
- Required: ✔️
- Min length:
1
SurrealQL query to execute.
conditions
- Type: array
- SubType: Condition
- Dynamic: ❌
- Required: ❌
List of conditions in order to limit the flow trigger.
connectionTimeout
- Type: integer
- Dynamic: ❌
- Required: ❌
- Default:
60
- Minimum:
> 0
Connection timeout. Default is 60
seconds.
interval
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
60.000000000
- Format:
duration
Interval 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
- Type: object
- SubType: string
- Dynamic: ✔️
- Required: ❌
- Default:
{}
Query parameters, can be named parameters.
See SurrealDB documentation about SurrealQL Prepared Statements for query syntax.This should be supplied with a parameter map using named parameters.
password
- Type: string
- Dynamic: ✔️
- Required: ❌
Plaintext authentication password.
port
- Type: integer
- Dynamic: ❌
- Required: ❌
- Default:
8000
- Minimum:
> 0
Connection port. Default value is 8000
.
stopAfter
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❌
List of execution states after which a trigger should be stopped (a.k.a. disabled).
useTls
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
false
Specify whether to use TLS for connection. Default is false
.
username
- Type: string
- Dynamic: ✔️
- Required: ❌
Plaintext authentication username.
Outputs
Definitions
Was this page helpful?